I’m trying to follow this guide.
I made virtualenv and installed flask in it:
Requirement already satisfied (use --upgrade to upgrade): Flask in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied (use --upgrade to upgrade): Werkzeug>=0.7 in /usr/local/lib/python2.7/dist-packages (from Flask)
Requirement already satisfied (use --upgrade to upgrade): Jinja2>=2.4 in /usr/local/lib/python2.7/dist-packages (from Flask)
After pip freeze > requirements.txt the file contains only:
argparse==1.2.1
distribute==0.6.28
wsgiref==0.1.2
And there is no Flask package. I’m trying to run simple example and got:
ImportError: No module named flask
How to install the package properly?
You need to run
pip freeze > reuirements.txtinside your virtualenv. Thus, make sure that your virtualenv was activated correctly. As the Heroku documentation is mostly written from Linux point of view, this may be a little tricky especially on Windows (see a related question):venv\Scripts\activate.batvenv\Scripts\activate.ps1instead.Note that you need to activate virtualenv for
sudoas well. Example:However one of the points in virtualenv is that you don’t need sudo. Thus, you could simply omit using sudo and simply just run: