0

when I run pip3 it crashes.

Here's what I get: ubuntu@ip-xxx-xx-xx-xx:/var/www/html/pythonscrape$ pip3 --version Traceback (most recent call last): File "/usr/local/bin/pip3", line 7, in from pip._internal.cli.main import main File "/usr/local/lib/python3.5/dist-packages/pip/_internal/cli/main.py", line 57 sys.stderr.write(f"ERROR: {exc}") ^ SyntaxError: invalid syntax

One thing I'll add though, is that when I type the pip command, it shows that it is working for 2.7, however I do not want to use that version. ubuntu@ip-xxx-xx-xx-xx:/var/www/html/pythonscrape$ pip --version pip 8.1.1 from /usr/lib/python2.7/dist-packages (python 2.7)

It looks like there is some kind of clash with the versions?

Should I even be using pip (i.e. not pip3) in python3?

Ultimately, my goal is to install bs4 for beautiful soup.

Brent Heigold
  • 1,213
  • 5
  • 24
  • 50
  • It looks like you have tangled up your Python versions somehow. You are running a version of `pip` for Python 3.6 or later (since it uses [f-strings](https://www.python.org/dev/peps/pep-0498/)) with an older version of Python that does not support them (the error message references Python 3.5). How did you install Python? – ChrisGPT was on strike Feb 16 '22 at 03:11
  • Side note: [Python 3.6 is end-of-life](https://www.python.org/dev/peps/pep-0494/). Unless there are other constraints, you should be using at least Python 3.7 in 2022. – ChrisGPT was on strike Feb 16 '22 at 03:13
  • https://stackoverflow.com/search?q=%5Bpip%5D+sys.stderr.write%28f%22ERROR%3A+%7Bexc%7D%22%29 – phd Feb 16 '22 at 07:36
  • Hi guys, so I'll try that then, I'll just build a new server and install a newer version of Python. Thanks so much for all your help. – Brent Heigold Feb 17 '22 at 05:06

0 Answers0