I am trying to install my TelegramBot based on Aiogram on PythonAnywhere servers.
I setup the environment based on python3.7
I installed my dependencies with:
pip install -r requirements.txt --user
I set up the environment and launched it with:
virtualenv env
. env/bin/activate
But once I launch my app this is the result with an error apparently on load_dotenv:
(env) 22:35 ~ $ python3 main.py
Traceback (most recent call last):
File "main.py", line 4, in <module>
import dispatcher
File "lib/dispatcher.py", line 2, in <module>
from dotenv import load_dotenv
ModuleNotFoundError: No module named 'dotenv'
Any ideas why on PythonAnywhere server the python-dotenv library seems not working properly?
Thanks
3
Answers
This was the correct path to follow:
Otherwise there was a confusion also in the python versions.
You need to run
pip install -r requirements.txt
with the environment activatedIt looks like you’re mixing two ways of installing packages.
pip install
with the--user
flag installs packages outside the virtualenv. So you should runIf it still doesn’t work, perhaps you don’t have
dotenv
in yourrequirements.txt
file? Try doing…and see if that helps.