virtualenv on cygwin returns AssertionError



当我尝试通过以下方式在Cygwin上创建虚拟环境时:

$virtualenv venv

但是,它返回错误:

AssertionError: Filename C:Python367Libos.py does not start with any of these prefixes: ['C:\python367', 'C:\python367']

我在 Windows 7 上尝试了此问题下的所有解决方案 virtualenv 返回断言错误,但它没有帮助。

在我向其他人寻求帮助后,我得到了根本原因:

我使用的是安装在我的Windows系统中的python和virtualenv,因此我在我的问题中提出了错误。

$ which python
/cygdrive/c/Python367/python <== the python I'm using there is installed in my windows system

解决方案是,在Cygwin上安装python和virtualenv,然后通过相同的命令创建virtualenv。之后,您可以看到python路径位于:

$ which python3
/usr/bin/python3 
$ pip3 install virtualenv
Collecting virtualenv

这对我有用!

最新更新