-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Improve error message for python 3.5 EOL experience #9526
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
Comments
Potentially another idea - might be to have pypi refuse to return pip==21 to python3.5 clients who are asking. I'm not sure whether pypi actually listens/hears the python version - though that solution seems too complex. Given that python3.5 is EOL, I'm mostly in favor of a better error message that suggests getting off python3.5 or pinning pip==20 |
I guess we could add an interpreter version check to The problem is that by the time the user sees that version, it's mostly too late - they already have the wrong pip version installed, and it won't work (so they can't use it to uninstall/downgrade pip). |
Fortunately Python 3.5 has
I would welcome a PR adding an import-time check to either |
This has been fixed by pypa/get-pip#85; and other users are recommended to first update to a version of pip that shipped with their interpreter. |
Hi @pradyunsg - I took a look at the diff and it's nonobvious how it fixes the issue. Could you help clarify? The issue arises here because when a user uses the recommended instructions to self-update pip It's not clear to me how a developer stuck on python3.5 (eg stuck on ubuntu 16.04) would see an improved error message from this change to get-pip. I may be missing something about how it works. |
We don't control the version of pip that Ubuntu 16.04 ships with. That is so old that the enhancements we've made for improving experience around "minimum Python version required" are not included in it. We can't provide the up-to-date experience to users using really old versions of pip. :) Overall, the degraded experience is fixed in the current version of pip and across all of our supported distribution mechanisms (ensurepip will just-work, and get-pip.py got updated in that PR). I don't think there's anything actionable for pip here TBH. |
I believe the suggestion in the above post was to action it w/ a check early in main for python version - w/ a helpful error message. To be clear, not trying to say that we should continue to support python3.5 - but rather - try to dodge the situation where folks who are stuck w/ some environments with python3.5 - pinning their pip to 20 (eg mypy CI). It doesn't sound like pypa/get-pip#85 fixed the issue, but it does sound like you're maybe recommending not actioning this task? |
There’s really no good way to show a human-friendly error message in this situation though. The syntax error happens on import time, so pip does not even have a chance to execute anything before it happens. The only way to achieve what you want is for pip to avoid using any new syntax features, which I hope is understanably a lot to ask from maintainers. The get-pip.py solution is the best pip can do. |
Yeah - if it were to suggest a better error message - it would have to be some kind of check at the top of I suspect folks stuck in this situation are likely just putting |
Fix BBB CI, update role, bump versions (#55) - Bump version to commit 0104e9eefcaf88b9129a287953984fcaa63adc41 ebbba-org/ansible-role-bigbluebutton@0104e9e - Add default variables - Update README - Auto update only security packages to avoid BBB package issues - Make reboot if required more robust, remove reboot tag - Remove unused handler msmtp config check - Fix dict object has no attribute, remove extra space - Fix conditionals - Bump geerlingguy.pip role version - Bump n0emis.bigbluebutton role version - Use bbb_greenlight_users variable instead of executing a rake command https://github.com/n0emis/ansible-role-bigbluebutton/blob/master/defaults/main.yml#L31 - Update pip version and install dependencies to fix PyPi issues - Install specific pip version in CI pypa/pip#9526
Uh oh!
There was an error while loading. Please reload this page.
Hiya - we ran into this debugging challenge a couple of times at internally Dropbox, as well as on the mypy CI (see python/mypy@e1b34b5)
I want to acknowledge python3.5 is EOL and we want to minimize having to deal with it. However, currently, we have several systems still on ubuntu 16.04 - and it's challenging to get off it - we're working on it, but wanted to file this as I'm optimistic there's a low cost workaround. It took many eng hours to isolate the problem to this issue =\
python3.5 ships out with pip==8 - and pip dropped support for py3.5 in pip==21 (which launched Jan 2021)
pip IS intelligent enough such that when you run
pip install --upgrade pip
from a python3.5 installation - it will not upgrade to pip==21, due to metadata frompython_requires
(https://www.python.org/dev/peps/pep-0345/)However, pip learned this python-version-metadata logic in pip==9, so the pip that ships with py3.5 will happily update itself to pip==21 and irreversibly break (since pip 21 uses fstrings)
The workaround is to either pin pip==20
OR first upgrade to smarter pip (anything between 9-20) and then upgrade
The former workaround is the more-obvious solution and I suspect many people are doing it now. Esp if it's on common code that runs across multiple python versions (like the mypy CI linked above) - this is probably bad.
The latter is harder to figure out.
I can think of a couple ideas to solve this
I don't know pip very well, so I'm of course totally open to other solutions as well.
The text was updated successfully, but these errors were encountered: