GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
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'
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.
closing as dupe to #355, since it's more generic.
Use inspect to avoid virtual env custom site package pypa/virtualenv#228
Revert "Use inspect to avoid virtual env custom site package pypa/vir…
This reverts commit 058bebf.
Fix Qt plugin paths (Refs: 59faf29)
site.getsitepackages() doesn't work inside virtualenv: