Forums

No module named web3

Hey guys, I am new to hosting server. When I try to run my server it raises the following error:

File "/home/matteo/matteo.pythonanywhere.com/bacheca/utils.py", line 1, in <module>
from web3 import Web3 ModuleNotFoundError: No module named 'web3'

Even if I run

pip3.9 install --user web3

Do I have to run other commands before?

Make sure that you are installing the module into the version of Python/virtualenv that your web app is running.

The error arises when I run

pa_autoconfigure_django.py --nuke --python=3.9 https://github.com/matteorazzanelli/django-redis-project.git

How can I check the version you mention? How can I make sure to install the module in the right folder/virtualenv?

What is the sequence of commands to execute starting from an empty environment?

If you're using pa_autoconfigure_django.py, then you need to include the modules that you want to use in the requirements.txt file in your project.

Thanks, it works. The site is now live.

Glad to hear that!