Installing Flask with Virtualenv
You need to source the bin/activate
script first in the new flask folder to activate the virtualenv.
If you are running bash
(most likely) then run:
cd new/flask/directory. bin/activatepip install ...
When you want to get out of the virtualenv, you can quit the terminal tab, or run:
deactivate
Note that when you activate a virtualenv, it only is active in the one terminal tab you are in.
If you don't run that command first, then pip
will try to install into your system directories, thus giving the permission errors you are seeing.
The virtualenv has to be activated before after creating it.
Change to the virtualenv directory you just created and source the activation script from the bin directory:
$ source flask/bin/activate
Also, have a look at the first answer here: Warnings and errors after trying to install Flask 0.9
Error says: error: could not create '/Library/Python/2.7/site-packages/flask': Permission denied
which means you need root permissions to install flask. Try sudo pip install flask==0.9