Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a sandbox in virtualenv with python 2.7 fails on ubuntu?

Why is virtualenv complaining about missing _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
like image 830
Frankie Ribery Avatar asked Jun 13 '11 07:06

Frankie Ribery


1 Answers

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

For use with Python 2.7, upgrade virtualenv to 1.5.1 or newer. You can check your current version with virtualenv --version.

like image 181
robots.jpg Avatar answered Oct 23 '22 04:10

robots.jpg