error when try to install flask in the virtual enviroment
Question: I just configure the environment to develop the flask based web app. All the
things goes smoothly, but when I run my hello world app, the python interpret
tell me no module named flask:

    
    
    Traceback (most recent call last):
      File "hello.py", line 1, in <module>
        from flask import Flask
    ImportError: No module named flask
    

but I seriously install flask.

When I get the error, i just run the command in the virtual environment, `sudo
pip install flask`. Then, the console show the message:

    
    
    (venv)ubuntu@localhost:/var/www/demoapp$ sudo pip install flask
    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)
    Requirement already satisfied (use --upgrade to upgrade): itsdangerous>=0.21 in /usr/local/lib/python2.7/dist-packages (from flask)
    Requirement already satisfied (use --upgrade to upgrade): markupsafe in /usr/local/lib/python2.7/dist-packages (from Jinja2>=2.4->flask)
    Cleaning up...
    

Who can tell me how can I run my hello world flask app?


Answer: When you run

> $ sudo pip install...

system pip will be used. So to install flask in current environment just run

> $ pip install ... or as: $ /path/to/venv/bin/pip install ...

Or make your venv able to load global system packages by parameter --system-
site-packages, while configure virtual environment.

