【问题标题】:Creating a sandbox in virtualenv with python 2.7 fails on ubuntu?在 ubuntu 上使用 python 2.7 在 vi​​rtualenv 中创建沙箱失败?
【发布时间】:2011-06-13 07:28:17
【问题描述】:

为什么 virtualenv 抱怨缺少_weakrefset

laptop:~/sandbox$ virtualenv --python=/usr/bin/python2.7 --no-site-packages play
Running virtualenv with interpreter /usr/bin/python2.7
New python executable in play/bin/python2.7
Also creating executable in play/bin/python
Traceback (most recent call last):
  File "/home/ribery/sandbox/play/lib/python2.7/site.py", 
    line 67, in <module>
  import os
  File "/home/ribery/sandbox/play/lib/python2.7/os.py", line 398, 
    in <module>
  import UserDict
File "/home/ribery/sandbox/play/lib/python2.7/UserDict.py", line 83, 
    in <module>
  import _abcoll
File "/home/ribery/sandbox/play/lib/python2.7/_abcoll.py", line 11, 
    in <module>
  from abc import ABCMeta, abstractmethod
File "/home/ribery/sandbox/play/lib/python2.7/abc.py", line 8, 
    in <module>
  from _weakrefset import WeakSet
ImportError: No module named _weakrefset
ERROR: The executable django-py27/bin/python2.7 is not functioning
ERROR: It thinks sys.prefix is '/home/ribery/sandbox' 
(should be '/home/ribery/sandbox/play')
ERROR: virtualenv is not compatible with this system or executable

【问题讨论】:

  • virtualenv --version 显示的是什么版本?

标签: python virtualenv python-2.7


【解决方案1】:

https://github.com/pypa/virtualenv/issues/76

要与 Python 2.7 一起使用,请将 virtualenv 升级到 1.5.1 或更高版本。您可以通过virtualenv --version查看您当前的版本。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-03-26
    • 1970-01-01
    • 2012-08-31
    • 1970-01-01
    • 2019-02-11
    • 2016-09-19
    • 2013-01-19
    • 2014-06-20
    相关资源
    最近更新 更多