I am using virtualenv 1.9.1 on cygwin under win 7. Each virtualenv is created without any parameters (other than the directory name, obviously). There are no fancy settings.
All virtualenvs are fresh, in the sense that I did not create any shell scripts and did not edit any of the virtualenv scripts. I am absolutely sure that I am not doing anything special (for example, I am not abusing virtualenv, but not taking actions that upset his work), which makes PYTHONPATH absent from several virtualenvs.
Virtualenv activates a script for each new virtualenv does not create PYTHONPATH. pip installs packages under $VIRTUAL_ENV/lib/python2.7/site-packages/<packagedir> (e.g. lib/python2.7/site-packages/html5lib ).
pip behavior seems desirable. However, starting python (after virtualenv is activated) means that packages that are installed without pips are not loaded (that is, "there is no module named ...").
Update: adding PYTHONPATH to activate really "fixes" the problem. Obviously, I donโt want to manually maintain this, nor do I update activate_this.py . I would still like to know why virtualenvs now don't work right out of the box.
What's the solution? virtualenv never did this. What is wrong with him?
Update 2: Here is the result of virtualenv working with -vv:
$ virtualenv -vv newvirtualenv Creating newvirtualenv/lib/python2.7 Symlinking Python bootstrap modules Symlinking newvirtualenv/lib/python2.7/config Symlinking newvirtualenv/lib/python2.7/lib-dynload Symlinking newvirtualenv/lib/python2.7/os.py Ignoring built-in bootstrap module: posix Symlinking newvirtualenv/lib/python2.7/posixpath.py Cannot import bootstrap module: nt Symlinking newvirtualenv/lib/python2.7/ntpath.py Symlinking newvirtualenv/lib/python2.7/genericpath.py Symlinking newvirtualenv/lib/python2.7/fnmatch.py Symlinking newvirtualenv/lib/python2.7/locale.py Symlinking newvirtualenv/lib/python2.7/encodings Symlinking newvirtualenv/lib/python2.7/codecs.py Symlinking newvirtualenv/lib/python2.7/stat.py Symlinking newvirtualenv/lib/python2.7/UserDict.py File newvirtualenv/lib/python2.7/lib-dynload/readline.dll already exists Symlinking newvirtualenv/lib/python2.7/copy_reg.py Symlinking newvirtualenv/lib/python2.7/types.py Symlinking newvirtualenv/lib/python2.7/re.py Symlinking newvirtualenv/lib/python2.7/sre.py Symlinking newvirtualenv/lib/python2.7/sre_parse.py Symlinking newvirtualenv/lib/python2.7/sre_constants.py Symlinking newvirtualenv/lib/python2.7/sre_compile.py File newvirtualenv/lib/python2.7/lib-dynload/zlib.dll already exists Symlinking newvirtualenv/lib/python2.7/warnings.py Symlinking newvirtualenv/lib/python2.7/linecache.py Symlinking newvirtualenv/lib/python2.7/_abcoll.py Symlinking newvirtualenv/lib/python2.7/abc.py Symlinking newvirtualenv/lib/python2.7/_weakrefset.py Creating newvirtualenv/lib/python2.7/site-packages Writing newvirtualenv/lib/python2.7/site.py Writing newvirtualenv/lib/python2.7/orig-prefix.txt Writing newvirtualenv/lib/python2.7/no-global-site-packages.txt Creating parent directories for newvirtualenv/include Symlinking newvirtualenv/include/python2.7 Creating newvirtualenv/bin New python executable in newvirtualenv/bin/python2.7 Changed mode of newvirtualenv/bin/python2.7 to 0755 Also creating executable in newvirtualenv/bin/python Changed mode of newvirtualenv/bin/python to 0755 Testing executable with newvirtualenv/bin/python2.7 -c "import sys;out=sys.stdout;getattr(out, "buffer", out).write(sys.prefix.encode("utf-8"))" Got sys.prefix result: u'/cygdrive/c/Users/marcin/Documents/codeprojects/newvirtualenv' Creating newvirtualenv/lib/python2.7/distutils Writing newvirtualenv/lib/python2.7/distutils/__init__.py Writing newvirtualenv/lib/python2.7/distutils/distutils.cfg Using existing setuptools egg: /usr/lib/python2.7/site-packages/virtualenv_support/setuptools-0.6c11-py2.7.egg Installing setuptools... Running command /cygdrive/c/Users/ma...ualenv/bin/python2.7 -c "#!python \"\"\"Bootstra...sys.argv[1:]) " -v /usr/lib/python2.7/s...ols-0.6c11-py2.7.egg Processing setuptools-0.6c11-py2.7.egg Copying setuptools-0.6c11-py2.7.egg to /cygdrive/c/Users/marcin/Documents/codeprojects/newvirtualenv/lib/python2.7/site-packages Adding setuptools 0.6c11 to easy-install.pth file Saving /cygdrive/c/Users/marcin/Documents/codeprojects/newvirtualenv/lib/python2.7/site-packages/easy-install.pth Installing easy_install script to /cygdrive/c/Users/marcin/Documents/codeprojects/newvirtualenv/bin changing mode of /cygdrive/c/Users/marcin/Documents/codeprojects/newvirtualenv/bin/easy_install to 755 Installing easy_install-2.7 script to /cygdrive/c/Users/marcin/Documents/codeprojects/newvirtualenv/bin changing mode of /cygdrive/c/Users/marcin/Documents/codeprojects/newvirtualenv/bin/easy_install-2.7 to 755 Installed /cygdrive/c/Users/marcin/Documents/codeprojects/newvirtualenv/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg Processing dependencies for setuptools==0.6c11 Finished processing dependencies for setuptools==0.6c11 ...Installing setuptools...done. Installing existing pip-1.3.1.tar.gz distribution: /usr/lib/python2.7/site-packages/virtualenv_support/pip-1.3.1.tar.gz Installing pip... Running command /cygdrive/c/Users/ma...ualenv/bin/python2.7 -x /cygdrive/c/Users/ma...env/bin/easy_install /usr/lib/python2.7/s...ort/pip-1.3.1.tar.gz Processing pip-1.3.1.tar.gz Running pip-1.3.1/setup.py -q bdist_egg
Marcin
source share