Pip doesn't work in Python - Ubuntu
To install pip in Ubuntu, a standard package manager, we can run command - for Ubuntu 16.04
To check installation version, we run
respectively
and returns
pip 20.3.4 from
/usr/local/lib/python2.7/dist-packages/pip (python 2.7)
And it seems all done. However, this raises
a problem before you really start to use the pip.
【Key Problem】
The key question here is that the pip version does
not specifically locate correct python version which we desire to be python
3.6 in this case whilst now 2.7. This can be an issue for version mismatch
because the latest pip version no longer served python 2.7.
Hence you will not be able to install dependencies via the pip for python development. You may receive system errors containing
sys.stderr.write(
f"ERROR: {exc}")
^
SyntaxError: invalid syntax
【Solution】
run
given your python version is 3.6
Check again your pip and pip3 version
and
and you expect to see
pip 20.3.4 from
/usr/local/lib/python3.6/dist-packages/pip (python 3.6)
which indicates pip is now successfully locating
python 3.6.
【Further discussion】
https://stackoverflow.com/questions/66212924/pip-sys-stderr-writeferror-exc-with-python-3-5
https://stackoverflow.com/questions/65869296/installing-pip-is-not-working-in-python-3-6
留言
張貼留言