-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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.getsitepackages() missing #737
Comments
Do you use Python 2.7? In this case, its a duplicate of #355 . |
This was indeed using Python 2.7. |
As a workaround: |
It would be nice if any of virtualenv's maintainers took a look at this and provide some guidance as to where the problem is… |
The problem (as I understand it) is that virtualenv implements its own version of Fixing this isn't as simple as "sync up to the core Hope that helps - I'm replying as a virtualenv maintainer offering some guidance, but it's not something I'm planning on working on myself. As usual, patches welcome, but anyone willing to take this on should be clear on the amount of testing effort involved. For example, technically I believe we still support Python 2.6, so do we need to make sure that |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Just add a comment if you want to keep it open. Thank you for your contributions. |
I've gotten this issue on Python 3.7.0, Windows 10, in a virtualenv. As a workaround that seems to be holding, outside of the virtualenv, I did:
Then I simply edited the site.py in my virtualenv, and added the missing function:
It's a hacky workaround, but hopefully this helps someone else. |
Same problem with Windows 10 and Python 3.7 |
It work!s |
Dude this is so cool! |
@maludwig - Nice. I'm assuming the reason virtualenv's site.py doesn't include this function is because virtualenv is supposed to keep you deliberately away from using system-wide packages? But if some package explicitly calls this function then it's inevitably going to break when trying to run in a virtualenv? |
I'm seeing this on multiple machines, Windows 10 Python 3.7 and 3.8. It makes virtualenv unusable unfortunately. |
Why is this one closed? Seems still reproducible also with Python 3 |
Can you post a reproducible with latest virtualenv? |
I am seeing this on Mac, with virtualenv==20.0.34 and when trying to use pyre 0.0.56. |
Reported also on pyre tracker: facebook/pyre-check#326 |
Can you post a reproducible with latest virtualenv? |
I want to know specifics, how you created the virtualenv, what was the output of the creation (with -vvv?), what host Python you're using? |
Method `site.getsitepackages()` won't work with `virtualenv`, so that we have to use `distutils.sysconfig`get_python_lib()` instead. See also: pypa/virtualenv#737
The standard site.getsitepackages() function is not available in a virtualenv:
The text was updated successfully, but these errors were encountered: