Install & Compatibility
Where this runs
tested against v10.4.1 · 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
py 3.10
✕ build_error
✓ 15.1s
py 3.11
✕ build_error
✓ 11.9s
py 3.12
✕ build_error
✓ 10.1s
py 3.13
✕ build_error
✓ 10.8s
py 3.9
✕ build_error
✕ build_error
200MB installed
● package 200MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
bt
✓ import bittensor as bt
✗ from bittensor import bt
The module itself is bittensor, not bittensor.bt. Use import bittensor as bt.
Wallet
✓ from bittensor import Wallet
✗ from bittensor.wallet import Wallet
In v10+, Wallet is exported from the top-level bittensor module.
Subtensor
✓ from bittensor import subtensor
✗ from bittensor.subtensor import Subtensor
Use bittensor.subtensor (function) to get a Subtensor instance. Direct import of Subtensor class is discouraged.
Connects to the Bittensor test network, creates/generates a wallet, and prints the subnet 1 metagraph and balance.
import bittensor as bt
# Connect to the network (finney testnet or mainnet)
subtensor = bt.subtensor(network='test')
# Create a wallet (will prompt for password if new)
wallet = bt.Wallet(name='test-wallet')
# Get the metagraph for subnet 1
metagraph = subtensor.metagraph(1)
print('Subnet 1 metagraph:', metagraph)
# Check hotkey balance
balance = subtensor.get_balance(wallet.coldkeypub.ss58_address)
print('Balance:', balance)
btcli --version
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'bittensor.bittensor'
In v10+, the module structure changed. The old bittensor.bittensor module is removed.
fixUse import bittensor as bt and access bittensor.core instead.
TypeError: __init__() got an unexpected keyword argument 'max_retries'
The 'max_retries' parameter was renamed to 'max_attempts' in v10.0.0rc3.
fixReplace max_retries with max_attempts in the call.
bittensor.errors.NetworkError: Cannot connect to network 'finney'
The default network 'finney' may be unreachable or require correct endpoint configuration.
fixSpecify a valid network like 'test' or set environment variable BITTENSOR_NETWORK.
Upgrade
Version history
10.4.1latest on PyPI · released Jun 11, 2026
Audit
Dependencies
numpyrequiredUsed for tensor operations and numerical computations.
torchoptionalRequired for PyTorch tensor support (common in miner/validator code).