Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

virtualenv sensitive to unnormalized python paths #165

ianb opened this Issue Aug 17, 2011 · 1 comment


None yet
2 participants

ianb commented Aug 17, 2011

If you install a package globally with easy_install, then create a virtualenv, sys.path will be sensitive to how you invoke the virtualenv Python interpreter.

A rough way to reproduce:

$ /usr/bin/easy_install SomePackage
$ virtualenv test-env
$ ./test-env/bin/python -c 'import sys, pprint; pprint.pprint(sys.path)' > normal-path.txt
$ ./test-env/../test-env/bin/python -c 'import sys, pprint; pprint.pprint(sys.path)' > unnormal-path.txt
$ diff -u normal-path.txt unnormal-path.txt

You should see that /usr/lib/pythonX.Y/site-packages/SomePackage-X.Y.egg appears in different locations on sys.path depending on how the Python interpreter is invoked. In practice this can mean the global egg does or does not override the local egg depending on the invocation.

Note: this has only been reproduced on two different Ubuntu systems, I'm not sure about other platforms.

sid0 commented Aug 17, 2011

If anybody else hits this issue, one workaround (if you don't care about any site packages) is to use --no-site-packages to set up the virtualenv.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment