Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

issues with getsitepackages under a virtualenv

I wanted to check out which Python interpreter was running under my virtual env so I just entered the virtualenv and used getsitepackages. This is what came out.

(test)~/Documents/Development/test$ python
Python 2.7.9 (default, Apr  7 2015, 07:58:25) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import site
>>> print site.getsitepackages()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'getsitepackages'
>>>

Is this normal behaviour when operating under a virtualenv? If possible how would I correct, or should I even bother?

like image 262
guptam Avatar asked Oct 19 '22 13:10

guptam


1 Answers

A user has the same problem as you.

There is a known bug, that Python 2.7 isn't compatible with site.py. This bug is still open, since November 2012.

You have to leave virtualenv or use another version of Python.

like image 84
tjati Avatar answered Oct 29 '22 13:10

tjati