{"id":27981,"library":"nebula3-python","title":"NebulaGraph Python Client","description":"Python client library for NebulaGraph v3.x graph database. Current version 3.8.3 on PyPI, but the 5.x series (v5.2.2) is the new generation with async-native client, connection/session pools, and ORM. The v3.x line is stable and still maintained for legacy NebulaGraph v3 deployments.","status":"active","version":"3.8.3","language":"python","source_language":"en","source_url":"https://github.com/vesoft-inc/nebula-python","tags":["graph-database","nebula-graph","database-client","distributed-graph"],"install":[{"cmd":"pip install nebula3-python","lang":"bash","label":"Install stable v3 client"},{"cmd":"pip install 'nebula3-python>=5.0.0'","lang":"bash","label":"Install latest v5.x (new generation)"}],"dependencies":[{"reason":"Used for async HTTP/2 communication with NebulaGraph v5.x","package":"httpx","optional":true},{"reason":"Required for ORM models (v5.x only)","package":"pydantic","optional":true}],"imports":[{"note":"The package is imported as 'nebula3' not 'nebula3_python'","wrong":"from nebula3_python import ConnectionPool","symbol":"ConnectionPool","correct":"from nebula3.gclient.net import ConnectionPool"},{"note":"Session is in the gclient.net submodule","wrong":"from nebula3_python import Session","symbol":"Session","correct":"from nebula3.gclient.net import Session"},{"note":"Correct module path uses 'common' not 'gclient'","wrong":"from nebula3_python.common import AuthResult","symbol":"AuthResult","correct":"from nebula3.common import AuthResult"},{"note":"SSL support is only available in v3.8.2+ and imported from gclient.net","wrong":"from nebula3.settings import SSLContext","symbol":"SSLContext","correct":"from nebula3.gclient.net import SSLContext"}],"quickstart":{"code":"import os\nfrom nebula3.gclient.net import ConnectionPool\nfrom nebula3.Config import Config\n\nconfig = Config()\nconfig.max_connection_pool_size = 10\n\npool = ConnectionPool()\naddresses = [(\"127.0.0.1\", 9669)]\nuser = os.environ.get('NEBULA_USER', 'root')\npassword = os.environ.get('NEBULA_PASSWORD', 'nebula')\n\nif not pool.init(addresses, config):\n    raise Exception(\"Connection pool initialization failed\")\n\nsession = pool.get_session(user, password)\nresult = session.execute('SHOW SPACES;')\nprint(result)\nsession.release()\npool.close()","lang":"python","description":"Initialize a connection pool, get a session, execute a simple query, and release resources."},"warnings":[{"fix":"Match client major version to server major version: v3 client for v3 server, v5 client for v5 server.","message":"NebulaGraph v5.x is not compatible with nebula3-python. Use nebula3-python>=5.0.0 for v5.x and nebula3-python<5 for v3.x.","severity":"breaking","affected_versions":">=5.0.0 (client) and v3.x client vs v5 server"},{"fix":"Upgrade to v3.8.2 or later, or avoid SessionPool and manage sessions manually with ConnectionPool.","message":"The 'SessionPool' class was introduced in v3.8.0 but is only stable when using TLS (v3.8.2+). Without TLS, connections may leak. Use 'ConnectionPool' with explicit session management as a safe fallback.","severity":"gotcha","affected_versions":"3.8.0 - 3.8.1"},{"fix":"Use 'node.properties()' or 'node.values()' to get actual data instead of tag names.","message":"The 'Node.tags()' method returns a list of tag names, not a list of tag values. This changed in v3.8.0; prior versions returned tag values. If you depend on tag values, use 'Node.properties()' or 'Node.values()'.","severity":"gotcha","affected_versions":"3.8.0+"},{"fix":"Replace session.execute_json(query) with session.execute(query) and handle ResultSet as_dict() or as_primitive().","message":"The 'nebula3.gclient.net.Session.execute_json()' method is deprecated in v3.8.3. Use 'session.execute()' and parse the ResultSet instead.","severity":"deprecated","affected_versions":"3.8.3"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Use: pool.init(addresses, config) where config is a Config object, not a dict.","cause":"Passing config as a separate argument instead of as keyword argument.","error":"nebula3.gclient.net.ConnectionPool.init() takes 2 positional arguments but 3 were given"},{"fix":"Use: from nebula3.gclient.net import ConnectionPool","cause":"Incorrect import path. This is typically because one uses 'import nebula3' instead of 'from nebula3.gclient.net import ConnectionPool'.","error":"AttributeError: module 'nebula3' has no attribute 'ConnectionPool'"},{"fix":"Set NEBULA_USER and NEBULA_PASSWORD environment variables, or use default (root/nebula). Verify credentials in NebulaGraph.","cause":"Incorrect username or password, or using root with a password when no password is set.","error":"nebula3.common.AuthError: Authentication failed"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}