如何用pypy创建virtualenv?

min*_*end 27 python pypy virtualenv

运行以下命令

virtualenv -p /usr/local/bin/pypy pypy
Run Code Online (Sandbox Code Playgroud)

退出时出错

Running virtualenv with interpreter /usr/local/bin/pypy
New pypy executable in pypy/bin/pypy
debug: WARNING: Library path not found, using compiled-in sys.path.
debug: WARNING: 'sys.prefix' will not be set.
debug: WARNING: Make sure the pypy binary is kept inside its tree of files.
debug: WARNING: It is ok to create a symlink to it from somewhere else.
'import site' failed
AttributeError: 'module' object has no attribute 'prefix'
ERROR: The executable pypy/bin/pypy is not functioning
ERROR: It thinks sys.prefix is u'/Users/myname' (should be u'/Users/myname/pypy')
ERROR: virtualenv is not compatible with this system or executable
Run Code Online (Sandbox Code Playgroud)

我正在使用CPython 2.7.3运行Mac OS X 10.8.1(Mountain Lion)并使用Brew安装pypy 1.9.virtualenv的版本是1.8.4

使用从pypy网站直接下载的Mac OS X预构建的pypy二进制文件没有任何区别

Mic*_*kel 22

这似乎是1.8.4的回归.在我的系统上尝试这一切时,一切都运行良好的virtualenv 1.8.2,然后我升级,现在我得到了与你相同的错误.

  • 我在https://github.com/pypa/virtualenv/issues/366上提交了一份错误报告 (3认同)
  • 我降级到1.8.2并且它有效!谢谢!由于这是一个答案,我认为你应该提到*如何*降级到1.8.2``"sudo pip install virtualenv == 1.8.2``` (2认同)