-
-
Notifications
You must be signed in to change notification settings - Fork 386
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
Android build fails if py
command finds Python 3.12: ModuleNotFoundError: No module named 'pip._vendor.six.moves'
#1480
Android build fails if py
command finds Python 3.12: ModuleNotFoundError: No module named 'pip._vendor.six.moves'
#1480
Comments
I can't reproduce this on macOS. With a clean Python3.8 venv, Briefcase at 0.3.16.dev275+g939b17a2, I get a clean build of a Helloworld project. Pip is v23.2.1, Setuptools v68.2.2, wheel v0.41.2; pip freeze returns:
|
Couldn't reproduce on Linux either. If you look at |
This appears to be a Chaquopy problem, but I've never seen it before. Chaquopy tries to run it's own bundled copy of pip in an isolated environment, so it shouldn't be affected by anything on the build machine other than Python itself. But some things have leaked through in the past, such as via environment variables (e.g. chaquo/chaquopy#777). |
I take it python/bp/pip/_vendor/six.py actually exists, and hasn't been deleted by an anti-virus or something? |
Agreed; I thought I was using an environment without that. Nonetheless, the same is happening without it. briefcase.2023_10_06-19_39_47.build.log
It does exist.
I've been trying to get rid of the issue by recreating the virtual environment as well as the helloworld project...but it persists... |
From the verbose Gradle log, I see that |
This seems to come down to relying on the Nonetheless, I would expect users to hit this if they are using Python installations that don't really interact or depend on the |
ModuleNotFoundError: No module named 'pip._vendor.six.moves'
py
command find Python 3.12: ModuleNotFoundError: No module named 'pip._vendor.six.moves'
py
command find Python 3.12: ModuleNotFoundError: No module named 'pip._vendor.six.moves'
py
command finds Python 3.12: ModuleNotFoundError: No module named 'pip._vendor.six.moves'
I guess the question for me is: should the build process really proceed forward if it's using a different version of Python than the developer is trying to use? |
OK, this is the downside of using a bundled copy of pip: eventually it will become incompatible with new versions of Python. Testing with 3.12 was already on my list for the next Chaquopy version (chaquo/chaquopy#931), but I didn't get to it in time for the 3.12 stable release. Upstreaming our patches into pip would make it easier to use a newer version of pip, and avoid this kind of thing in the future (chaquo/chaquopy#981). I'd prefer for Chaquopy not to require a perfect Python version match, as this could raise the barrier to entry for new users. The only other reason why a Python version mismatch could matter is bytecode compilation, and Chaquopy already handles that by showing a warning and allowing the compilation to happen on the target device. However, we could improve the way in which it searches for a matching Python version. Currently the preference order on WIndows is So my suggestion is to move There is one complication: the Gradle daemon doesn't update its PATH, so it won't notice if you switch between virtual environments (gradle/gradle#10483). But I think this change would fix a lot of common cases without making any of them worse. |
I was wondering about this as well. I've noticed if I change the Python version for Briefcase by switching virtual environments, a previous version of Python is used. More specifically, if I first use Python 3.10 to run So, what's driving the persistent use of Python 3.10 here? Is it the Python version in If so, I really think we need we should inform users this is happening and how it might be mitigated...if we can't prevent it altogether. Especially since a common MO right now is to tell users to use an older Python for package availability...but then using an older Python doesn't seem to work either and it's rather opaque why. |
Although, thinking about this more broadly, if a user changes virtual environments after Some experiments:
Seems relevant: |
Yes. So if there's a Also relevant: |
The original error will be fixed by Chaquopy 15.0.1, which should be released within the next couple of weeks. This issue should be left open until Briefcase has updated to that. |
Happened on my machine (Windows 11 amd64). After I removed Python 3.12, installed 3.11, rebooted and recreated venv, I still get this error running
While there's only |
After changing your venv's Python version, you'll need to re-run |
Fixes beeware/briefcase#1480 with Python 3.12: No module named 'pip._vendor.six.moves'
Describe the bug
Android build fails during bootstrapping
pip
install. This may not be the best place to log this but wanted to report and go from there.This testing is simply using Briefcase's helloworld sample project.
Steps to reproduce
Using Python 3.8 or 3.9, run
briefcase build android
.Expected behavior
Build is successful.
Screenshots
No response
Environment
0.3.16.dev282+ge1b9deee
and0.3.15
Logs
briefcase.2023_10_05-06_11_14.build_normal_debug.log
briefcase.2023_10_05-06_13_34.build_verbose_debug.log
Additional context
No response
The text was updated successfully, but these errors were encountered: