0

I was trying to install a python module for both python3 and python2, and I had to upgrade pip, however, after running

pip install --upgrade pip

it would give me the following error:

Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/ubuntu/.local/lib/python3.5/site-packages/pip/__main__.py", line 21, in <module>
    from pip._internal.cli.main import main as _main
  File "/home/ubuntu/.local/lib/python3.5/site-packages/pip/_internal/cli/main.py", line 60
    sys.stderr.write(f"ERROR: {exc}")
                                   ^
SyntaxError: invalid syntax

I am not sure what the issue is, and whenever I use the command to install anything else, it's the same issue

Edit: I also tried to use pip3 and ran into the same error

Doc
  • 1
  • 2
  • pip dropped support for py3.5- and py2. also check [this](https://stackoverflow.com/questions/65869296/installing-pip-is-not-working-in-python-3-6) – Copperfield Mar 21 '21 at 15:49

1 Answers1

0

Not sure but I think that f-strings syntax is only available python3 and onwards, maybe trying pip3 install --upgrade [pip|pip3]

Aram Maliachi
  • 215
  • 2
  • 8
  • I am getting the same error, should I uninstall then reinstall? – Doc Mar 21 '21 at 15:50
  • some OS include python (pip) for misc tasks. Don't uninstall simply install python3 along with pip3... same error with `python3 -m pip install --upgrade pip` ? – Aram Maliachi Mar 21 '21 at 16:00