Take the 2-minute tour ×

I am trying to set up Flask on Ubuntu 10.04 LTS. I have install virtualenv 1.7 I am using python 2.6

I set my virtualenv and easy_install Flask But when I check in my python import Flask fails

The Flask.egg is present in my virtualenv site-pakages.

Any suggestions ?

share|improve this question
Have you activated virtualenv? $ source bin/activate –  reclosedev Dec 27 '11 at 14:22
Yes I did activated the virtualenv. If i try which easy_install i get the right path. –  gpasse Dec 27 '11 at 18:15
add comment

3 Answers

up vote 8 down vote accepted
  • use lowercase:

    import flask
  • “multi-version” mode might be in effect. Try pkg_resources.require() before importing Flask.

share|improve this answer
those two solutions made it work. –  gpasse Dec 27 '11 at 23:15
add comment

type 'python' in shell and then type 'import flask', if there is no error, you can use it.

share|improve this answer
add comment

Create a virtual environment inside your project directory:

virtualenv venv-name

Activate your virtual environment activated using:

source venv-name/bin/activate


pip install flask

Do NOT use 'sudo' before the above command.


pip freeze

This should print out Flask==0.9 or something similar along with any other software you've installed in the virtual Python environment. Now try starting python in a terminal with the command 'python'. Type the following at the prompt to check whether you can import flask.

>>> from flask import Flask
>>> Flask
<class 'flask.app.Flask'>
share|improve this answer
add comment

Your Answer


