{"id":23683,"library":"etcd3gw","title":"etcd3gw","description":"A Python client for the etcd v3 API via the etcd grpc-gateway. Version 2.6.0, requires Python >=3.10. Release cadence is irregular.","status":"active","version":"2.6.0","language":"python","source_language":"en","source_url":"https://github.com/etcd-io/etcd3gw","tags":["etcd","distributed-systems","key-value-store","client"],"install":[{"cmd":"pip install etcd3gw","lang":"bash","label":"PyPI install"}],"dependencies":[{"reason":"HTTP client for API calls","package":"requests","optional":false},{"reason":"Underlying HTTP library","package":"urllib3","optional":false}],"imports":[{"note":"Etcd3Client is not exposed at package level in 2.x. Must import from submodule.","wrong":"from etcd3gw import Etcd3Client","symbol":"Etcd3Client","correct":"from etcd3gw.client import Etcd3Client"},{"note":"In version 1.x, direct import worked. Version 2.x changed location.","wrong":"","symbol":"Etcd3Client","correct":"from etcd3gw import Etcd3Client"}],"quickstart":{"code":"from etcd3gw.client import Etcd3Client\n\nclient = Etcd3Client(host='localhost', port=2379)\nclient.put('/key', 'value')\nvalue, metadata = client.get('/key')\nprint(value)","lang":"python","description":"Create a client, write a key, read it back."},"warnings":[{"fix":"Change imports to `from etcd3gw.client import Etcd3Client`.","message":"In version 2.0, the import path changed from `etcd3gw` to `etcd3gw.client`. Code using `from etcd3gw import Etcd3Client` will break.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Unpack the result: `value, metadata = client.get(key)`.","message":"The `get()` method now returns a tuple `(value, metadata)` instead of just `value`. In v1, `client.get(key)` returned the value as a string. In v2, it returns `(value, metadata)`.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Ensure your etcd cluster exposes the grpc-gateway (port 2379 by default).","message":"Support for etcd v3.3 and earlier removed; requires etcd with v3 API and gateway endpoint.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Call a simple operation like `client.get('/health')` to verify connection.","message":"Client initialization does not validate connectivity; exceptions only occur on first actual operation.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure your application works with UTC for lease TTL values.","message":"Timezone not handled in lease TTL; all times treated as UTC.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install etcd3gw` in the correct Python environment.","cause":"Library not installed or installed in wrong environment.","error":"ModuleNotFoundError: No module named 'etcd3gw'"},{"fix":"Use `from etcd3gw.client import Etcd3Client`.","cause":"Using wrong import path for version 2.x.","error":"ImportError: cannot import name 'Etcd3Client' from 'etcd3gw'"},{"fix":"Update to v2 and unpack: `value, metadata = client.get(key)`. If stuck on v1, do not unpack.","cause":"Calling `client.get(key)` and trying to unpack the result, but the library version returns a string (v1) instead of tuple (v2).","error":"TypeError: cannot unpack non-iterable str object"},{"fix":"Verify etcd is running and the gateway endpoint (usually port 2379) is accessible. Check host/port arguments.","cause":"etcd gateway not running or unreachable at given host:port.","error":"ConnectionError: HTTPConnectionPool ... Failed to establish a new connection"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}