2

Im trying to install the numpy package with python3 (python --version returns Python 3.5.2), but it doesnt work. Somebody can help me please with this problem? When i use the command

pip install numpy

, the terminal return to me

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

I've tried install using Python2.7 but it was dreprecation

zepolik
  • 47
  • 4

1 Answers1

2

You have, mysteriously, a version of pip that is using f-strings, such as f"ERROR: {exc}", even though f-strings were not introduced until Python 3.6. Furthermore, recent versions of NumPy support Python 3.7 and above.

Try installing a more recent version of Python3, activating a virtual environment, and installing with python3 -m pip install numpy.

Python 3.5 is also EOL as of 2020-09-30.

Brad Solomon
  • 38,521
  • 31
  • 149
  • 235