2
pip freeze output:
aiohttp==3.8.1
aiosignal==1.2.0
alembic==1.7.5
aniso8601==9.0.1
async-timeout==4.0.1
attrs==21.2.0
base58==2.1.1
bitarray==1.2.2
certifi==2021.10.8
charset-normalizer==2.0.7
click==8.0.3
cytoolz==0.11.2
eth-abi==2.1.1
eth-account==0.5.6
eth-hash==0.3.2
eth-keyfile==0.5.1
eth-keys==0.3.3
eth-rlp==0.2.1
eth-typing==2.2.2
eth-utils==1.10.0
Flask==2.0.2
flask-marshmallow==0.14.0
Flask-Migrate==3.1.0
Flask-RESTful==0.3.9
Flask-Script==2.0.6
Flask-SQLAlchemy==2.5.1
frozenlist==1.2.0
hexbytes==0.2.2
idna==3.3
ipfshttpclient==0.8.0a2
itsdangerous==2.0.1
Jinja2==3.0.3
jsonschema==3.2.0
lru-dict==1.1.7
Mako==1.1.6
MarkupSafe==2.0.1
marshmallow==3.14.1
marshmallow-sqlalchemy==0.26.1
multiaddr==0.0.9
multidict==5.2.0
netaddr==0.8.0
parsimonious==0.8.1
protobuf==3.19.1
psycopg2==2.9.2
pycryptodome==3.11.0
pyrsistent==0.18.0
pytz==2021.3
requests==2.26.0
rlp==2.0.1
six==1.16.0
SQLAlchemy==1.4.27
toolz==0.11.2
typing_extensions==4.0.0
urllib3==1.26.7
varint==1.0.2
web3==5.25.0
websockets==9.1
Werkzeug==2.0.2
yarl==1.7.2

Python version: 3.10.0

I installed Web3 using the pip install web3 command in my venv.

To create my venv, I did virtualenv -p python3 venv, so I don't think there is an issue with the virtual env.

However in my test.py when I do the following:

from web3 import Web3

I get a traceback error that there is no module named "web3"

Patrick Yoder
  • 1,065
  • 4
  • 14
  • 19
whitebat 199
  • 172
  • 2
  • 9

1 Answers1

3

Are you sourcing your venv before running test.py?

If so, then try this,

source venv/bin/activate 
pip uninstall web3==5.25.0
pip install web3==5.25.0
python test.py

(Since your pip freeze is correct), try this as well

which python

This should give you the python bin that is currently being used by your shell. (Check if the path you get is the venv one).

Mudit Verma
  • 374
  • 2
  • 6
  • thank you that worked, i think the problem is with the vscode code runner extension, it seems like it doesn't recognize the venv i will try to seek a solution for that – whitebat 199 Nov 22 '21 at 13:53