0

When i try to uninstall pip, I am getting the error below

$python2.7 -m pip uninstall pip Traceback (most recent call last): File "/usr/lib64/python2.7/runpy.py", line 162, in _run_module_as_main "__main__", fname, loader, pkg_name) File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/usr/lib/python2.7/site-packages/pip-21.0.1-py2.7.egg/pip/__main__.py", line 21, in <module> from pip._internal.cli.main import main as _main File "/usr/lib/python2.7/site-packages/pip-21.0.1-py2.7.egg/pip/_internal/cli/main.py", line 60 sys.stderr.write(f"ERROR: {exc}") ^ SyntaxError: invalid syntax 

I ran whereis pip to know the location it is installed. It returned

/usr/bin/pip /usr/bin/pip2.7 

When I was trying to install pip, I tried yum install python27-python-pip and then easy_install pip by mistake from where it started to error out like this. How can I fix this ?

1

1 Answer 1

0

PIP community discontinued the support to 2.7. You will have to upgrade pip to latest version.

pip install -upgrade pip 
2
  • Welcome to the site, and thank you for your contribution. You may want to add a link to the site where you found the discontinuation notice. Also, it might be of interest to other readers why the lack of python 2.7 support would lead to complains about a syntax error. Commented Feb 26, 2021 at 10:51
  • pip.pypa.io/en/stable/development/release-process/… Commented Mar 2, 2021 at 1:00

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.