0

I am trying to follow on my Ubuntu 20.04.1

https://linuxhint.com/install_python_pip_tool_ubuntu/

At the step

sudo python2 get-pip.py

I receive the error

Traceback (most recent call last):
  File "get-pip.py", line 24244, in <module>
    main()
  File "get-pip.py", line 199, in main
    bootstrap(tmpdir=tmpdir)
  File "get-pip.py", line 82, in bootstrap
    from pip._internal.cli.main import main as pip_entry_point
  File "/tmp/tmpKGsQqS/pip.zip/pip/_internal/cli/main.py", line 60
    sys.stderr.write(f"ERROR: {exc}")

Is it the dust of the script or I do something wrong?

Nurqm
  • 4,715
  • 2
  • 11
  • 35
katang
  • 2,474
  • 5
  • 24
  • 48
  • 3
    `f"ERROR: {exc}"` is Python 3 syntax (f-strings), so it you'd need to run this with a Python 3 interpreter. – Carcigenicate Feb 05 '21 at 19:02
  • 1
    You can just do `apt install python3-pip` as well to get pip. I've found that to be pretty easy. – Carcigenicate Feb 05 '21 at 19:03
  • 1
    More specifically you need Python 3.6+. – astrochun Feb 05 '21 at 19:07
  • forget `Python 2` and use only `Python 3`. And I think `Ubuntu 20.04.1` should already have installed `Python 3` and `pip` for `Python 3`. – furas Feb 05 '21 at 19:26
  • Thanks for the ideas. I do not use Python otherwise. I just wanted to install pip to install conan, to install my development environment. And, I had to rely on LinuxHint. Which suggests to install Python 2, then Python 3. BTW: my Ubuntu said: pip Command 'pip' not found, but there are 18 similar ones. After sudo apt install python3-pip ditto. – katang Feb 06 '21 at 20:11
  • In the light of the comments found on the links shown in the closing comment, especially that "pip 21.0 dropped support for Python 2 and 3.5. The later versions require Python 3.6+. The syntax f"" is supported by Python 3.6+." I decided to drop conan, pip and Python from my toolchain. Thanks for the hints. – katang Feb 17 '21 at 17:38

0 Answers0