Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Setting Up a Local Python Environment Installing Python and Python Libraries Locally Using virtualenv

igsm '
igsm '
10,440 Points

Virtualenvwrapper installation

Hey! Please help, I struggle to set up virtualenvwrapper. I use Windows 7. I did pip install virtualenvwrapper, which was successful (python34/lib/site-packages) but further I do not understand what is required when I follow the documentation.

For example, what does it mean and where can I find it? 'Add three lines to your shell startup file...'

Thanks.

Kenneth Love

2 Answers

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,457 Points

Are you trying to run virtualenvwrapper in the windows command prompt or powershell?

For command prompt, installation instructions here

For powershell, installation instructions here

The "Add three lines...." is for running virtualenvwrapperin compatible Bourne shell such as bash, ksh, or zsh on OS X and Linux.

igsm '
igsm '
10,440 Points

Thanks. I figured it out and also installed flask into the venv. But now I have another challenge.

I run the virtualenv in my command prompt and then open up a script in IDE. I import flask and enter some code for test. If I run the script in python IDE - it says, ImportError: No module named 'flask', however, it is all good if I do it through windows command prompt while venv is enabled...

How can I run python scripts in IDE while the virtualenv is enabled? It seems like when I test my script in IDE, there is no connection with venv.

I even tried to install flask on a system level and in that case the script runs fine in the IDE. Can't figure it out with venv... Please help.

P.S. I also installed virtualenvwrapper-win