Unable to import package from virtualenv

I have a one line script in my project that imports a package (flask_mail). I am running it in virtualenv. If I follow through python script.py

, I get ImportError: No module named flask_mail

. If in the same folder, with the same virtual, I open the python console and run the same command from my file script.py

( import flask_mail

), I don't get any errors.

Virtualenv was created with the following command: virtualenv venv

and then activatedsource venv/bin/activate

What am I doing wrong here?

0


source to share





All Articles