0

Pip says:

# ./get-pip.py
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.

This message is maybe just a joke, as Python3.5 is installed on my system:

% python3.5
Python 3.5.2 (default, Jan 26 2021, 13:30:48) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

Surely Pip, which is written by versioning experts, is smart enough to notice this. However, when I then try to run pip, I stop laughing. Pip says:

% pip
Traceback (most recent call last):
  File "/usr/local/bin/pip", line 5, in <module>
    from pip._internal.cli.main import main
  File "/home/user/.local/lib/python2.7/site-packages/pip/_internal/cli/main.py", line 60
    sys.stderr.write(f"ERROR: {exc}")
                                   ^
SyntaxError: invalid syntax

Surely Pip -- a VERSIONing system -- understands how to invoke the VERSION of Python that Pip itself is written in? What is going on?

personal_cloud
  • 3,943
  • 3
  • 28
  • 38
  • This is what's going on: https://stackoverflow.com/a/65871131/7976758 – phd Mar 07 '21 at 23:52
  • Despite this you can ignore EOL warning and continue using Python versions you like. I use Python 2.7 and 3.4+. See https://stackoverflow.com/q/54915381/7976758 – phd Mar 07 '21 at 23:53
  • @phd Oh, hmm I hadn't realized I was on Pip 21.0. I thought I had cleaned out 21.0 and gone back to 8.1.1. Pip is hard to clean out I guess. – personal_cloud Mar 07 '21 at 23:55
  • `pip` is not hard but you always have to remember you usually have many different Pythons (in `/usr/bin/`, `/usr/local/bin/`, `$HOME/.local/bin/`) and for every Python you could have many `pip`s. Sometimes you need to run through all directories in the `$PATH` and remove all outdated scripts manually. – phd Mar 08 '21 at 00:00
  • @phd Yes, the problem was my `$HOME/.local/lib/python2.7/site-packages/pip`. I erased it and now my `pip` is working again. Thank you! – personal_cloud Mar 08 '21 at 00:05

0 Answers0