Python virtualenv questions
Posted
by
orokusaki
on Stack Overflow
See other posts from Stack Overflow
or by orokusaki
Published on 2010-12-24T19:11:56Z
Indexed on
2010/12/24
22:54 UTC
Read the original article
Hit count: 296
I'm using VirtualEnv on Windows XP. I'm wondering if I have my brain wrapped around it correctly.
I ran virtualenv ENV
and it created C:\WINDOWS\system32\ENV
. I then changed my PATH
variable to include C:\WINDOWS\system32\ENV\Scripts
instead of C:\Python27\Scripts
. Then, I checked out Django into C:\WINDOWS\system32\ENV\Lib\site-packages\django-trunk
, updated my PYTHON_PATH
variable to point the new Django directory, and continued to easy_install
other things (which of course go into my new C:\WINDOWS\system32\ENV\Lib\site-packages
directory). I understand why I should use VirtualEnv so I can run multiple versions of Django, and other libraries on the same machine, but does this mean that to switch between environments I have to basically change my PATH
and PYTHON_PATH
variable? So, I go from developing one Django project which uses Django 1.2 in an environment called ENV
and then change my PATH
and such so that I can use an environment called ENV2
which has the dev version of Django?
Is that basically it, or is there some better way to automatically do all this (I could update my path in Python code, but that would require me to write machine-specific code in my application)?
Also, how does this process compare to using VirtualEnv on Linux (I'm quite the beginner at Linux).
© Stack Overflow or respective owner