Possible Duplicate:
Python – It is possible to install another version of Python to Virtualenv?
Within my (virtualenv activated) env folder, it appears as though the python2.7 folder has symlinks to absolute paths for my system python installation.
This is not ideal.
Even when I install from a local path, and use virtualenv to set and environment in a folder env, the paths to Python are absolute, and a dependency on the OS environment is established. I want to rid this dependency and make the python interpreter, as well as all software relying upon it, completely independent.
Let’s imagine that I want python2.6 to be included IN the env tree as a STAND-ALONE installation without symlinks to my system folders.
How does one accomplish this feat of extraordinary non-linkage?
$ > pwd
/Users/foo/development/v1/bar/env
(env)
$ > ls -l lib/python2.7/
total 920
lrwxr-xr-x 1 foo staff 82 Oct 15 16:48 UserDict.py -> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.py
...
lrwxr-xr-x 1 foo staff 85 Oct 15 16:48 _weakrefset.py -> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_weakrefset.py
Thank you for your help.
EDIT: Moreover, it will be most ideal to have the virtualenv (including the local python install) relocatable.
UPDATE: Please ALSO refer to Is it possible to install another version of Python to Virtualenv?
Big thanks to @millimoose, et al.
Here’s what I ended up doing, very specifically. I will update if I encounter problems in the future.
Set up environment folders.
Get Python-2.7.3, and virtualenv without any form of root OS installation.
Extract and install Python-2.7.3 into the
pyenvdir.make cleanis optional if you are doing this a 2nd, 3rd, Nth time…Create your virtualenv
Fix the symlink to python2.7 within
env/include/Fix the remaining python symlinks in env. You’ll have to delete the symbolically linked directories and recreate them, as above. Also, here’s the syntax to force in-place symbolic link creation.
Test
Aloha.