As usual, after installing python3-pip
on a newly built instance, I got an error message when trying to use pip
.
$ pip3 install pip
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
Looking at the link that says "please see", it seems that there are various problems after upgrading pip.
It seems that the most reliable method is to install with python -m pip
, although there are various things such as installing with --user
is less likely to cause problems.
I always use pip after updating it to the latest version, so I will try --upgrade
as usual.
$ python3 -m pip install --upgrade pip
Collecting pip
Cache entry deserialization failed, entry ignored
Using cached https://files.pythonhosted.org/packages/54/0c/d01aa759fdc501a58f431eb594a17495f15b88da142ce14b5845662c13f3/pip-20.0.2-py2.py3-none-any.whl
Installing collected packages: pip
Successfully installed pip-20.0.2
You have successfully upgraded to the latest version.
$ python3 -m pip --version
pip 20.0.2 from /home/ubuntu/.local/lib/python3.6/site-packages/pip (python 3.6)
I think I will use this method in the future.
pip
is included with Python since 3.4. https://docs.python.org/ja/3.6/installing/index.html
Therefore, the above method cannot be used before python3.4. Install and use pip as before.
Recommended Posts