'site' has no attribute "getsitepackages" #228

Closed
npinto opened this Issue Feb 24, 2012 · 3 comments

Comments

Projects
None yet
4 participants

npinto commented Feb 24, 2012

Any virtualenv, with or without --system-site-packages, gives me:

% python -c 'import site; site.getsitepackages()'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: 'module' object has no attribute 'getsitepackages'
Contributor

carljm commented Feb 24, 2012

Yes, one of the uglier aspects of virtualenv's implementation is that it has to have its own copy of the site module, which is used for all virtualenvs regardless of which version of Python they are created with. And this copy predates the addition of site.getsitepackages() (first added in Python 2.7, I believe).

I would have no objection to a pull request adding that function to virtualenv's site module, as long as the implementation is one that can work on all virtualenv-supported versions of Python (2.4 through 3.3a). Or if that's too difficult due to missing APIs in other areas of the earlier Python versions, perhaps have it conditionally defined depending on sys.version or something.

duplicate #355

Contributor

qwcode commented Feb 26, 2013

closing as dupe to #355, since it's more generic.

@qwcode qwcode closed this Feb 26, 2013

eerwitt added a commit to eerwitt/tensorflow that referenced this issue Jan 5, 2016

eerwitt added a commit to eerwitt/tensorflow that referenced this issue Jan 6, 2016

eerwitt added a commit to eerwitt/tensorflow that referenced this issue Jan 6, 2016

eerwitt added a commit to eerwitt/tensorflow that referenced this issue Jan 7, 2016

@JdeH JdeH referenced this issue in QQuick/Transcrypt Mar 11, 2016

Closed

module 'site' has no attribute 'getsitepackages' #13

kernc added a commit to kernc/orange3 that referenced this issue May 27, 2016

Fix Qt plugin paths (Refs: 59faf29)
site.getsitepackages() doesn't work inside virtualenv:
pypa/virtualenv#228
pypa/virtualenv#355
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment