Install & Compatibility
Where this runs
tested against v0.3.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.068s · 18MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 1.5s · import 0.060s · 18MB
16MB installed
● package 16MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ModbusClient
✓ from pyModbusTCP.client import ModbusClient
✗ from pymodbus import ModbusClient
Wrong library (pymodbus)
ModbusServer
✓ from pyModbusTCP.server import ModbusServer
✗ from pymodbus.server import ModbusServer
Wrong library (pymodbus)
constants
✓ from pyModbusTCP import constants
Create a Modbus TCP client, connect, and read holding registers.
from pyModbusTCP.client import ModbusClient
try:
c = ModbusClient(host='127.0.0.1', port=502, auto_open=True)
if c.read_holding_registers(0, 1):
print('success')
except Exception as e:
print(f'Error: {e}')
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pyModbusTCP'
Library not installed or wrong import casing.
fixpip install pyModbusTCP (capital M, B, T, C, P)
pyModbusTCP.client.exceptions.ConnectionError: Connection refused
Modbus server not running or wrong IP/port.
fixVerify server is running and reachable: ping 127.0.0.1, check port 502
ImportError: cannot import name 'ModbusClient' from 'pyModbusTCP'
Direct import from top-level package, not from submodule.
fixUse 'from pyModbusTCP.client import ModbusClient'
Upgrade
Version history
0.3.0latest on PyPI · released Sep 4, 2024
Audit
Dependencies
No dependency data recorded yet.