{"id":21768,"library":"pymgclient","title":"pymgclient","description":"Memgraph database adapter for Python language. Current version 1.5.2, supports Python >=3.9, Linux arm64 and wider libc compatibility. Released irregularly.","status":"active","version":"1.5.2","language":"python","source_language":"en","source_url":"https://github.com/memgraph/pymgclient","tags":["memgraph","database","graph","adapter","bolt"],"install":[{"cmd":"pip install pymgclient","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"pymgclient exposes the mgclient module; importing from pymgclient directly does not work.","wrong":"from pymgclient import connect","symbol":"connect","correct":"from mgclient import connect"}],"quickstart":{"code":"import os\nfrom mgclient import connect\n\nconn = connect(\n    host=os.environ.get('MG_HOST', '127.0.0.1'),\n    port=int(os.environ.get('MG_PORT', 7687)),\n    username=os.environ.get('MG_USER', ''),\n    password=os.environ.get('MG_PASS', '')\n)\ncursor = conn.cursor()\ncursor.execute(\"MATCH (n) RETURN n LIMIT 1\")\nprint(cursor.fetchone())\nconn.close()","lang":"python","description":"Connect to a Memgraph instance and run a simple query."},"warnings":[{"fix":"Upgrade Python to >=3.9 or use an older pymgclient version.","message":"Python versions <3.9 are no longer supported since v1.5.0.","severity":"breaking","affected_versions":"<1.5.0"},{"fix":"Use Python >=3.10 (Linux/Windows) or >=3.9 (macOS), or build from source.","message":"Binary wheels are no longer provided for Python <3.10 and macOS <3.9 since v1.4.0.","severity":"breaking","affected_versions":">=1.4.0"},{"fix":"Use 'from mgclient import ...' or 'import mgclient'.","message":"The library's top-level Python module is 'mgclient', not 'pymgclient'. Importing from 'pymgclient' directly will raise ModuleNotFoundError.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use 'import mgclient' or 'from mgclient import connect'.","cause":"The package name is 'pymgclient', but the Python module is 'mgclient'. The import should be 'import mgclient'.","error":"ModuleNotFoundError: No module named 'pymgclient'"},{"fix":"Run 'pip install pymgclient' and import as 'from mgclient import connect'.","cause":"Using an outdated import path or the library is not installed correctly.","error":"ImportError: cannot import name 'connect' from 'mgclient'"},{"fix":"Reinstall with 'pip install --upgrade pymgclient' and import as described.","cause":"The package may not be installed or the module name is wrong. Verify installation with 'pip list | grep pymgclient'.","error":"AttributeError: module 'mgclient' has no attribute 'connect'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}