简体   繁体   English

在Cygwin中创建virtualenv时出错

[英]Error creating virtualenv in Cygwin

I have installed Cygwin on my Win7 box; 我在Win7盒子上安装了Cygwin; also I installed python2.7, setuptools, easy_install, pip, etc... I installed virtualenv and virtaulenvwrapper using easy_install. 我也安装了python2.7,setuptools,easy_install,pip等...我使用easy_install安装了virtualenv和virtaulenvwrapper。

The problem is that, when I try now to create a virtualenv, I get the following: 问题是,当我现在尝试创建virtualenv时,我得到以下内容:

    $ 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. 我也尝试过不使用任何选项,只是mkvirtualenv temp但我得到了完全相同的错误。 I also created a symbolic link between python2.7.exe and python.exe.... again, no luck. 我还在python2.7.exe和python.exe之间创建了一个符号链接....再次,没有运气。

I searched online but I can't figure it out....any idea??? 我在网上搜索但我无法弄清楚....任何想法???

Something is broken for cygwin in version 1.8.3 and 1.8.4. 在版本1.8.3和1.8.4中,cygwin的某些内容已被破坏。 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. 如果您不想使用旧版本,git存储库的当前开发分支( https://github.com/pypa/virtualenv )工作正常。 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. 这在理论上意味着下一个版本应该是1.8.5,也将修复问题。

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. 显然,最新版本中存在一个错误,因此回滚到前一个版本并不是一件坏事,至少如果你像我一样使用Cygwin。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM