{"id":24281,"library":"py-geth","title":"py-geth","description":"py-geth is a Python library for running Go-Ethereum (geth) as a subprocess. It provides a convenient interface to manage Ethereum nodes, including downloading, installing, and interacting with geth. The current version is 6.4.0, supporting Python 3.8+. The library is actively maintained and follows the Ethereum release cadence.","status":"active","version":"6.4.0","language":"python","source_language":"en","source_url":"https://github.com/ethereum/py-geth","tags":["ethereum","geth","blockchain","node","dev"],"install":[{"cmd":"pip install py-geth","lang":"bash","label":"Default install"}],"dependencies":[{"reason":"For interacting with the Ethereum node via JSON-RPC","package":"web3","optional":true}],"imports":[{"note":"The main class to manage a geth node instance.","symbol":"GethProcess","correct":"from geth import GethProcess"},{"note":"Utility to get the path to the geth binary.","symbol":"get_binary_path","correct":"from geth import get_binary_path"},{"note":"Function to install a specific version of geth.","symbol":"install_geth","correct":"from geth import install_geth"},{"note":"A subclass that automatically uses --dev mode.","symbol":"DevGethProcess","correct":"from geth import DevGethProcess"}],"quickstart":{"code":"from geth import DevGethProcess\n\n# Start a dev geth instance with default settings\ngeth = DevGethProcess('~/ethereum')\ngeth.start()\n# Wait until the node is ready\ngeth.wait_for_rpc(timeout=60)\nprint(f'RPC available at {geth.rpc_url}')\ngeth.stop()","lang":"python","description":"Starts a Geth node in developer mode with a pre-funded account and mining enabled."},"warnings":[{"fix":"Use `from geth import install_geth; install_geth()` before starting a process.","message":"In v4+, the package uses an explicit binary download step. Previously, GethProcess would automatically download geth. Now you must call `install_geth()` or provide a pre-installed binary.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Manually download and sign the binary, or run `xattr -dr com.apple.quarantine /path/to/geth`.","message":"On macOS, geth binaries are not signed, and macOS Gatekeeper may block execution. This causes process.start() to fail silently.","severity":"gotcha","affected_versions":"all"},{"fix":"Replace `python_executable='/path/to/geth'` with `geth_executable='/path/to/geth'`.","message":"The `GethProcess` constructor argument `python_executable` is deprecated in v5+. Use `geth_executable` to specify the path to the geth binary.","severity":"deprecated","affected_versions":">=5.0.0"},{"fix":"Always provide an absolute path for the data directory, e.g., `DevGethProcess('/absolute/path')`.","message":"The default data directory is relative to the current working directory, which can cause unexpected behavior if not using absolute paths.","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":"Install geth using `install_geth()` or provide an explicit path with `geth_executable`.","cause":"geth binary is not installed or not in PATH.","error":"FileNotFoundError: [Errno 2] No such file or directory: 'geth'"},{"fix":"Use `from geth import install_geth; install_geth('1.13.4')` to download the binary.","cause":"geth binary is not installed in the system PATH.","error":"geth: command not found"},{"fix":"Access `geth.http_port` instead, or upgrade to py-geth >=5.","cause":"The property `rpc_url` was added in v5. Older versions use `http_port`.","error":"AttributeError: 'GethProcess' object has no attribute 'rpc_url'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}