You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in pip2.7 environment (yes, I know people still use Python2 as there are 1000s of systems not yet supporting python3) running a pip install --upgrade pip install version 21.1.0 which broke itself (pip2) with error:
File "/usr/bin/pip", line 9, in
load_entry_point('pip==21.0.1', 'console_scripts', 'pip2')()
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 378, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2566, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2260, in load
entry = import(self.module_name, globals(),globals(), ['name'])
File "/usr/lib/python2.7/site-packages/pip/_internal/cli/main.py", line 60
sys.stderr.write(f"ERROR: {exc}")
^
SyntaxError: invalid syntax
Expected behavior
pip upgrade should detect that it is running in python 2.x environment an should refuse to upgrade itself beyond v.20.x
How to Reproduce
inside python 2.7 environment run:
pip install --upgrade pip
now try to run pip - get error:
Output
pip install --upgrade pip File "/usr/bin/pip", line 9, in <module> load_entry_point('pip==21.0.1', 'console_scripts', 'pip2')() File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 378, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2566, in load_entry_point return ep.load() File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2260, in load entry = __import__(self.module_name, globals(),globals(), ['__name__']) File "/usr/lib/python2.7/site-packages/pip/_internal/cli/main.py", line 60 sys.stderr.write(f"ERROR: {exc}") ^SyntaxError: invalid syntax
Code of Conduct
I agree to follow the PSF Code of Conduct
The text was updated successfully, but these errors were encountered:
I suspect (you don't mention the version you're upgrading from) that the version of pip you're installing from doesn't support the Requires-Python metadata that addresses this issue. So you'll have to explicitly restrict the version you're upgrading to.
The good news is that once you've upgraded, the new pip will be able to detect that newer versions don't support Python 2.7, and so will not fail in this way in future...
pip version
19.1
Python version
2.7
OS
RHEL 7.9
Additional information
No response
Description
in pip2.7 environment (yes, I know people still use Python2 as there are 1000s of systems not yet supporting python3) running a pip install --upgrade pip install version 21.1.0 which broke itself (pip2) with error:
File "/usr/bin/pip", line 9, in
load_entry_point('pip==21.0.1', 'console_scripts', 'pip2')()
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 378, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2566, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2260, in load
entry = import(self.module_name, globals(),globals(), ['name'])
File "/usr/lib/python2.7/site-packages/pip/_internal/cli/main.py", line 60
sys.stderr.write(f"ERROR: {exc}")
^
SyntaxError: invalid syntax
Expected behavior
pip upgrade should detect that it is running in python 2.x environment an should refuse to upgrade itself beyond v.20.x
How to Reproduce
inside python 2.7 environment run:
pip install --upgrade pip
now try to run pip - get error:
Output
Code of Conduct
The text was updated successfully, but these errors were encountered: