{"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,"search_vec":"'3.8.3':14 '5':19 'async':29 'async-n':28 'client':3,5,31,57 'connection/session':32 'current':12 'databas':11,51,56 'database-cli':55 'deploy':48 'distribut':59 'distributed-graph':58 'generat':26 'graph':10,50,54,60 'graph-databas':49 'legaci':45 'librari':6 'line':38 'maintain':43 'nativ':30 'nebula':53 'nebula-graph':52 'nebulagraph':1,8,46 'new':25 'orm':35 'pool':33 'pypi':16 'python':2,4 'seri':21 'stabl':40 'still':42 'v3':47 'v3.x':9,37 'v5.2.2':22 'version':13 'x':20","created_at":"2026-05-09T05:53:05.704452+00:00","updated_at":"2026-05-09T05:53:05.704452+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":"https://www.nebula-graph.io","github":"https://github.com/vesoft-inc/nebula-python","docs":null,"changelog":null,"pypi":"https://pypi.org/project/nebula3-python/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["database","aws"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}