Registry / database / pymgclient

pymgclient

JSON →
library1.5.2pypypi✓ verified 89d ago

Memgraph database adapter for Python language. Current version 1.5.2, supports Python >=3.9, Linux arm64 and wider libc compatibility. Released irregularly.

pip install pymgclient
INSTALL
IMPORT
SIG · PYMGCLIENT
P
pymgclient
databasepythonv1.5.2
Install
3.6s avg
Import
10ms
Disk
61MB
Pass rate
4/ 10
Env Coverage4 / 10
glibc
3.9–3.13
musl
3.9–3.13
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
musl
glibc
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()
Debug
Known issues
breakingPython versions <3.9 are no longer supported since v1.5.0.
fix
Upgrade Python to >=3.9 or use an older pymgclient version.
affects: <1.5.0
breakingBinary wheels are no longer provided for Python <3.10 and macOS <3.9 since v1.4.0.
fix
Use Python >=3.10 (Linux/Windows) or >=3.9 (macOS), or build from source.
affects: >=1.4.0
gotchaThe library's top-level Python module is 'mgclient', not 'pymgclient'. Importing from 'pymgclient' directly will raise ModuleNotFoundError.
fix
Use 'from mgclient import ...' or 'import mgclient'.
affects: all
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'.
fix
Use '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.
fix
Run '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'.
fix
Reinstall 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.

Agent activity
7 hits · last 30 days
node
6
Resources
pymgclient — pip install pymgclient · libregistry