-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Virtualenv-provided pip3 doesn't work on macOS #27377
Comments
I had hoped that #27426 would remove a code path I was accidentally going down, but nope. Do we have a minimum required version of |
Oh, but my pip3 at 19.2.3 is |
I still don't know why this is happening, but I'm now suspecting that it's # -*- coding: utf-8 -*-
import re
import sys
from pip._internal.cli.main import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main()) |
I don't have a mac to try this on, sorry. I hear that @gsnedders knows something about macOS these days :p |
This comment has been minimized.
This comment has been minimized.
I don't really have anything helpful to say here. Presumably |
OK, so here are some things I've tried. I can get it running if I use virtualenv --version # 20.4.2
virtualenv _virtualenv
source _virtualenv/bin/activate
python3 --version # 3.8.2
pip3 --version # 21.0.1
pip3 install -r tools/wptrunner/requirements.txt
pip3 install -r tools/wptrunner/requirements_firefox.txt
./wpt --venv _virtualenv/ --skip-venv-setup run firefox css/css-flexbox/ I can also get things working using python3 --version # 3.8.2
python3 -m venv _venvmodule
source _venvmodule/bin/activate
python3 --version # still 3.8.2
pip3 --version # 19.2.3, which won't work so:
pip3 install --upgrade pip
pip3 --version # now 21.0.1
pip3 install -r tools/wptrunner/requirements.txt
pip3 install -r tools/wptrunner/requirements_firefox.txt
./wpt --venv _virtualenv/ --skip-venv-setup run firefox css/css-flexbox/ I suspect the difference is that The fact that I could get this working without using |
@gsnedders sorry I missed your question as I was writing my long comment.
After the Since invoking the same @gsnedders have you recently been able to just follow the documentation for getting things working on macOS, with no trouble? |
With the proviso that my Python installs aren't necessarily "normal", I've not had any problem, but I also don't touch WPT tooling that much at the moment. |
@gsnedders ah, so I take it you're not using the I do wonder if I've somehow messed up my setup, or if most people trying to |
…tualenv logic, a=testonly Automatic update from web-platform-tests Clean up some py3 checks adjacent to virtualenv logic Spotted as part of web-platform-tests/wpt#27377. -- wpt-commits: 050eae311ea3f56ebceceea9b04654226da9826c wpt-pr: 27588
After carefully getting rid of non-system versions of Python and site-packages this is still not working for me, so I debugged some more. I think the problem is with the order of things in
My system-provided pip3 is the one with its internals in
I think the problem is what the generated "activate_this.py" ends up doing. After the But, logging
That's exactly the same as the original
And that would work, because it get rids of the site-packages dir that has the system pip, and adds in the pip installed by virtualenv. This seems like a difference that might happen on all platforms but just happens to work if the system pip is sufficient, but I've confirmed that on my Linux workstation, Still don't know what to do about this. |
OK, so what's the difference between invoking (The value of https://stackoverflow.com/q/26323852 gives some clues about what |
Exactly how this all works isn't clear, but since the fix in python/cpython#9516 was to simply hide the environment variable from the interpreter it seems reasonably safe. Fixes #27377.
I'm trying to follow the instructions at https://web-platform-tests.org/running-tests/from-local-system.html after not having used
./wpt run
in a few months, and I can't get it to work. The instructions assume Python 2, which I assume is now wrong, but I can't figure out how to make it work with Python 3 either.Here's the error I'm getting on macOS after
pip3 install --user virtualenv
and trying./wpt --py3 run firefox css/css-flexbox/
:There was a similar error in #21691 and then it had something to do with a pip/python version mismatch, but I don't know what the mismatch is for me.
Does anyone currently have it working on macOS Big Sur and what setup is required?
cc @stephenmcgruer @gsnedders
The text was updated successfully, but these errors were encountered: