Install & Compatibility
Where this runs
tested against v1.5.2 · 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
py 3.10
✕ build_error
✓ 3.8s
py 3.11
✕ build_error
✓ 3.6s
py 3.12
✕ build_error
✓ 3.4s
py 3.13
✕ build_error
✓ 3.5s
py 3.9
✕ build_error
✕ build_error
61MB installed
● package 61MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
connect
✓ from mgclient import connect
✗ from pymgclient import connect
pymgclient exposes the mgclient module; importing from pymgclient directly does not work.
Connect to a Memgraph instance and run a simple query.
import os
from mgclient import connect
conn = connect(
host=os.environ.get('MG_HOST', '127.0.0.1'),
port=int(os.environ.get('MG_PORT', 7687)),
username=os.environ.get('MG_USER', ''),
password=os.environ.get('MG_PASS', '')
)
cursor = conn.cursor()
cursor.execute("MATCH (n) RETURN n LIMIT 1")
print(cursor.fetchone())
conn.close()
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pymgclient'
The package name is 'pymgclient', but the Python module is 'mgclient'. The import should be 'import mgclient'.
fixUse 'import mgclient' or 'from mgclient import connect'.
ImportError: cannot import name 'connect' from 'mgclient'
Using an outdated import path or the library is not installed correctly.
fixRun 'pip install pymgclient' and import as 'from mgclient import connect'.
AttributeError: module 'mgclient' has no attribute 'connect'
The package may not be installed or the module name is wrong. Verify installation with 'pip list | grep pymgclient'.
fixReinstall with 'pip install --upgrade pymgclient' and import as described.
Upgrade
Version history
1.5.2latest on PyPI · released Feb 17, 2026
Audit
Dependencies
No dependency data recorded yet.