Following the instructions on this page to install pip on python2 https://linuxhint.com/installing_pip_linux_mint/
It's failing at the last step, $ sudo python2 get-pip.py
with this error,
Traceback (most recent call last): File "get-pip.py", line 24226, 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/tmp2aZyDl/pip.zip/pip/_internal/cli/main.py", line 60 sys.stderr.write(f"ERROR: {exc}") ^ SyntaxError: invalid syntax
I've tried to look everywhere for a solution, but can't find one. What is it that I'm doing wrong?
One of the most common problems with running Python tools like pip is the “not on PATH” error. This means that Python cannot find the tool you're trying to run in your current directory. In most cases, you'll need to navigate to the directory in which the tool is installed before you can run the command to launch it.
pip installationTo use pip, first install a custom version of Python 2. pip is then installed with it. You can then use the pip command to create a virtualenv and install modules.
pip works with CPython versions 2.6, 2.7, 3.1, 3.2, 3.3, 3.4 and also pypy.
The approach you should take is to install pip for Python 3.2. Then, you can install things for Python 3.2 with pip-3.2 , and install things for Python 2-7 with pip-2.7 .
The correct get-pip.py
file for python2 has been moved to https://bootstrap.pypa.io/pip/2.7/get-pip.py
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With