5

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?

guptam
  • 157
  • 2
  • 11

1 Answers1

3

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.

tjati
  • 5,761
  • 4
  • 41
  • 56