Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'site' has no attribute "getsitepackages" #228

Closed
npinto opened this issue Feb 24, 2012 · 4 comments
Closed

'site' has no attribute "getsitepackages" #228

npinto opened this issue Feb 24, 2012 · 4 comments

Comments

@npinto
Copy link

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'
@carljm
Copy link

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.

@chaoflow
Copy link

duplicate #355

@qwcode
Copy link

qwcode commented Feb 26, 2013

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

@qwcode qwcode closed this as completed 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
kernc added a commit to kernc/orange3 that referenced this issue May 27, 2016
site.getsitepackages() doesn't work inside virtualenv:
pypa/virtualenv#228
pypa/virtualenv#355
@Tset-Noitamotua
Copy link

have this issue with Python 3.6.5

>> python --version && python -c "import site; print(site.getsitepackages())"
Python 3.6.5
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: module 'site' has no attribute 'getsitepackages'

not duplicate of #355

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants