[PYTHON] Is it deprecated to use pip directly?

I got an error message.

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.

Supplement

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

Is it deprecated to use pip directly?
What is pip and how do you use it?
When I try to use pip, SSL module is not available.
It is convenient to use Icecream instead of print when debugging.
[Python] What is pip? Explain the command list and how to use it with actual examples
Emacs perspective.el workspace is easier to use
[Pandas] What is set_option [How to use]
Install python on xserver to use pip
How to use is and == in Python
When you want to use it as it is when using it with lambda memo
It is better to use Weight Initializer when initializing with HeNormal with Chainer
If pip stops due to SSL, it is better to re-insert python itself
It is convenient to use Layers when putting a library on Lambda
It is more convenient to use csv-table when writing a table with python-sphinx
Make pip available on Mac (easy_install is deprecated)
Creating a Python document generation tool because it is difficult to use sphinx
How to use pip3 under proxy environment Note
How to install Cascade detector and how to use it
If you try to install Python2 pip after installing Python3 pip and it is rejected
How to use pip, a package management system that is indispensable for using Python
It is better to use NTFS when connecting SSD to Linux to create a file server.
How to use any or all to check if it is in a dictionary (Hash)
I realized that it is nonsense to use the module without thinking because it is convenient.
How to use Decorator in Django and how to make it
Scraping with Python-Selenium is old! ?? ・ ・ ・ How to use Pyppeteer
Smartly announce that it is a deprecated implementation --debtcollerctor
Re: Python lambda is useless ^ H ^ H ^ H ^ H ^ H Difficult to use
Install tweepy with pip and use it for API 1.1
How to use xml.etree.ElementTree
How to use Python-shell
How to use tf.data
How to use virtualenv
How to use Seaboan
How to use image-match
How to use shogun
How to use Pandas 2
How to install pip
How to use Virtualenv
Is it Google Colaboratory?
How to use numpy.vectorize
How to use pytest_report_header
Easy to use Flask
How to use partial
How to use Bio.Phylo
Use pip with MSYS2
How to use SymPy
How to use x-means
How to use WikiExtractor.py
How to use IPython
How to use virtualenv
How to use Matplotlib
How to use iptables
How to use numpy
Reasons to use logarithm
How to use TokyoTechFes2015
How to use venv
How to use dictionary {}
How to use Pyenv
Easy to use SQLite3
How to use list []
How to use python-kabusapi