简体   繁体   English

为什么python virtualenv命令在Windows 10上失败?

[英]Why is the python virtualenv command failing on Windows 10?

I am using Windows 10. I have been able to install virtualenv using pip. 我正在使用Windows10。我已经能够使用pip安装virtualenv。 I installed both Python 3.5 and python 2.7. 我同时安装了Python 3.5和python 2.7。 That was done from the command line. 这是从命令行完成的。 I even ran the commands as administrator. 我什至以管理员身份运行命令。 In my path, I have Python 3.5, and the corresponding Scripts folder, occurring prior to the path to python 2.7. 在我的路径中,我有Python 3.5和对应的Scripts文件夹,位于python 2.7的路径之前。 It appears to use the python 3.5 by default. 它似乎默认使用python 3.5。

So, when I ran the command 'virtualenv test' it starts to install a virtual environment but then it fails and I can verify that it did not actually complete the process of creating a virtual environment. 因此,当我运行命令“ virtualenv test”时,它开始安装虚拟环境,但随后失败,并且我可以验证它实际上没有完成创建虚拟环境的过程。 I posted the output of this command at this url: http://pastebin.com/NLZ6tKn1 As an additional note, I am running the command from the D drive and python 3.5 is installed in the Program Files folder on the C drive. 我在以下URL上发布了该命令的输出: http : //pastebin.com/NLZ6tKn1作为附加说明,我正在D驱动器上运行命令,并且在C驱动器上的Program Files文件夹中安装了python 3.5。

Thanks in advance for any help or suggestions, Bruce 预先感谢您的任何帮助或建议,布鲁斯

This is a bug specific to Windows and it happens when you have a space in the directory path where Python is installed. 这是Windows特有的错误,在安装Python的目录路径中有空格时会发生。

This is also why the default installer for Python uses a path like C:\\Python27\\ to install Python (for the 2.7 version). 这也是为什么Python的默认安装程序使用C:\\Python27\\类的路径来安装Python(针对2.7版本)的原因。

Your directory for Python is c:\\\\program files\\\\python 3.5 - please uninstall Python and then reinstall it to a path that doesn't have spaces. Python的目录为c:\\\\program files\\\\python 3.5请卸载Python,然后将其重新安装到没有空格的路径。

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

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