Can not import python-bitcoinlib right into a easy script

on

|

views

and

comments


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:

enter image description here

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?

Share this
Tags

Must-read

Waymo is attempting to seduce me. However an alternative choice is staring us within the face | Dave Schilling

It’s Tremendous Bowl weekend right here in America, which suggests a number of issues: copious quantities of gut-busting meals, controversial half-time present performances,...

Waymo raises $16bn to gas international robotaxi enlargement | Know-how

Self-driving automobile firm Waymo on Monday stated it raised $16bn in a funding spherical that valued the Alphabet subsidiary at $126bn.Waymo co-chief executives...

Self-driving taxis are coming to London – ought to we be anxious? | Jack Stilgoe

At the top of the nineteenth century, the world’s main cities had an issue. The streets had been flooded with manure, the unintended...

Recent articles

More like this

LEAVE A REPLY

Please enter your comment!
Please enter your name here