Install & Compatibility
Where this runs
tested against v1.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.092s · 19.2MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 2.4s · import 0.086s · 20MB
17MB installed
● package 17MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
AuthServiceProxy
✓ from bitcoinrpc.authproxy import AuthServiceProxy
✗ from bitcoinrpc import AuthServiceProxy
import from bitcoinrpc.authproxy directly, not from bitcoinrpc top-level
JSONRPCException
✓ from bitcoinrpc.authproxy import JSONRPCException
✗ from bitcoinrpc.exceptions import JSONRPCException
JSONRPCException is defined in authproxy module, not in exceptions
Connect to a Bitcoin Core RPC server using environment variables for credentials.
from bitcoinrpc.authproxy import AuthServiceProxy
rpc_user = os.environ.get('RPC_USER', 'user')
rpc_password = os.environ.get('RPC_PASSWORD', 'pass')
rpc_host = os.environ.get('RPC_HOST', '127.0.0.1')
rpc_port = os.environ.get('RPC_PORT', '8332')
# Note: python-bitcoinrpc expects URL with credentials embedded
url = f'http://{rpc_user}:{rpc_password}@{rpc_host}:{rpc_port}'
proxy = AuthServiceProxy(url)
# Test connection
print(proxy.getblockchaininfo())
Errors
Common errors & fixes
ImportError: No module named bitcoinrpc.authproxy
The package is not installed or installed in wrong environment.
fixRun 'pip install python-bitcoinrpc' and verify import path: from bitcoinrpc.authproxy import AuthServiceProxy
AttributeError: 'NoneType' object has no attribute 'group'
The library's regex parsing of the RPC response failed, often due to malformed response or unexpected characters.
fixEnsure the RPC server returns valid JSON. Check that the URL is correct and the server is running.
Error: unable to connect to RPC server
The RPC URL is incorrect or server is not reachable.
fixVerify RPC_HOST, RPC_PORT, and credentials. Test with curl: curl --user user:pass --data-binary '{"jsonrpc":"1.0","id":"curl","method":"getblockchaininfo","params":[]}' http://127.0.0.1:8332 Upgrade
Version history
1.0latest on PyPI · released Aug 24, 2016
Audit
Dependencies
No dependency data recorded yet.