I'm on a mac, and I know that any package I install goes to a specific folder in something like /Library/....
Now when I create a virtual environment, will it create a folder structure to store any libs underneath the virtual environment to isolate things?
e.g.
开发者_开发问答/home/user/mypythonvirtenv
/home/user/mypythonvirtenv/python2.6/....
Does it re-map the python environmental variables temporarily also?
Yes. Virtualenv will make you a directory tree that looks like:
mypythonvirtualenv/bin
mypythonvirtualenv/include
mypythonvirtualenv/lib
mypythonvirtualenv/lib/python2.6
mypythonvirtualenv/lib/python2.6/site-packages
When you want to use it, you source
the activate
script:
euclid:~ seth$ which python
/opt/local/bin/python
euclid:~ seth$ source /Users/seth/mypythonvirtualenv/bin/activate
(mypythonvirtualenv)euclid:~ seth$ which python
/Users/seth/mypythonvirtualenv/bin/python
Other python related stuff (such as easy_install
) will also work the "right" way.
精彩评论