0

I have installed the python3 from source Python 3.7.4

I am trying to install the pip, with following failure any idea on this will be very useful.

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py

sudo python3 get-pip.py

Traceback (most recent call last):
  File "get-pip.py", line 22711, in <module>
    main()
  File "get-pip.py", line 198, 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 "<frozen importlib._bootstrap>", line 1161, in _load_backward_compatible
  File "/tmp/tmp7grgb9bt/pip.zip/pip/_vendor/pkg_resources/__init__.py", line 92, in <module>
RuntimeError: Python 3.5 or later is required

$> python3 -V

Python 3.7.4
2
  • sudo python3 --version ? Compare echo $PATH and sudo sh -c 'echo $PATH'
    – phd
    Feb 3, 2020 at 12:45
  • Yes you are right /usr/local/bin not present in sudo -c 'echo $PATH'
    – R_SS
    Feb 4, 2020 at 4:55

1 Answer 1

0

Due to $PATH issue sudo python3 runs a different Python compared to python3. Add /usr/local/bin to PATH in /root/.bash_profile. Or simply run with full path:

sudo /usr/local/bin/python3 get-pip.py

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.