mdm
mdm

Reputation: 3988

Error creating virtualenv in Cygwin

I have installed Cygwin on my Win7 box; also I installed python2.7, setuptools, easy_install, pip, etc... I installed virtualenv and virtaulenvwrapper using easy_install.

The problem is that, when I try now to create a virtualenv, I get the following:

    $ mkvirtualenv --distribute --no-site-packages --python=/usr/bin/python2.7.exe temp
Running virtualenv with interpreter /usr/bin/python2.7.exe
New python executable in temp/bin/python2.7
Also creating executable in temp/bin/python.exe
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/virtualenv-1.8.4-py2.7.egg/virtualenv.py", line 2560, in <module>
    main()
  File "/usr/lib/python2.7/site-packages/virtualenv-1.8.4-py2.7.egg/virtualenv.py", line 964, in main
    never_download=options.never_download)
  File "/usr/lib/python2.7/site-packages/virtualenv-1.8.4-py2.7.egg/virtualenv.py", line 1065, in create_environment
    site_packages=site_packages, clear=clear))
  File "/usr/lib/python2.7/site-packages/virtualenv-1.8.4-py2.7.egg/virtualenv.py", line 1506, in install_python
    raise e
OSError: [Errno 2] No such file or directory

I also tried not using any option, just mkvirtualenv temp but it I got exactly the same error. I also created a symbolic link between python2.7.exe and python.exe.... again, no luck.

I searched online but I can't figure it out....any idea???

Upvotes: 1

Views: 2757

Answers (2)

Xuan
Xuan

Reputation: 5629

Something is broken for cygwin in version 1.8.3 and 1.8.4. Using an older version would solve the problem.

If you do not want to use older versions, the current develop branch of the git repository (https://github.com/pypa/virtualenv) is working fine. This command would give you that:

pip install https://github.com/pypa/virtualenv/tarball/develop

or

easy_install https://github.com/pypa/virtualenv/tarball/develop

This would in theory mean the next release, which should be 1.8.5, will also have the problem fixed.

Upvotes: 3

mdm
mdm

Reputation: 3988

Not a definitive answer, but this solved my problem: Link

Clearly there is a bug in the latest version, so rolling back to a previous one is not such a bad thing, at least if you're using Cygwin as I am.

Upvotes: 0

Related Questions