Im writing a easy python script to connect with a neighborhood bitcoin node and record transactions.
I created a digital surroundings with:
virtualenv bitcoinenv
After which activated:
supply bitcoinenv/bin/activate
The I put in python-bitcoinlib with:
pip set up python-bitcoinlib
I’ve a easy script:
import requests
import bitcoin.rpc
# Hook up with the native Bitcoin node
connection = bitcoin.rpc.Proxy()
# Get an inventory of unspent transactions
unspent_transactions = connection.listunspent()
# Print the unspent transactions
print(unspent_transactions)
And I run this with:
python bitcoin.py
However I get the error:
import bitcoin.rpc
ModuleNotFoundError: No module named 'bitcoin.rpc'; 'bitcoin' just isn't a bundle
Heres extra details about my surroundings. After I run:
which python
I get:
/Customers/me/Bitcoin/alternate/bitcoinenv/bin/python
After I run:
echo $VIRTUAL_ENV
I get:
/Customers/me/Bitcoin/alternate/bitcoinenv
After I go to /Customers/me/Bitcoin/alternate/bitcoinenv/lib/python3.8/site-packages and record the contents I see:
After I run pip --version I get:
pip 22.3.1 from /Customers/me/Bitcoin/alternate/bitcoinenv/lib/python3.8/site-packages/pip (python 3.8)
And once I run python --version I get:
Python 3.8.0
Has anybody any concept why I cant import the python-bitcoinlib library?

