Install PIP for Python 3 on Ubuntu

Install PIP for Python 3 on Ubuntu

The PyPA recommended tool for installing Python packages.

Install PIP for Python 3

On Ubuntu 17.10, PIP is not installed by default. Python 3.6.3 is installed. So let’s install PIP for Python 3 first.
You can check the version of Python 3 that is installed on your Ubuntu operating system with the following command:

$ python3 --version

Before you try to install anything new on Ubuntu operating system, run the following command to update the package repository cache of Ubuntu:

$ sudo apt-get update

To install PIP for Python3 on Ubuntu, run the following command:

$ sudo apt-get install python3-pip

Now press ‘y’ and then press <Enter> to continue. It should take a while to download and install all these new packages depending on your internet connection.
Once the installation is complete, you can check the version of PIP for Python 3 using the following command:

$ pip3 --version

You can see that, the version of PIP. According to the official website of PIP, this is the latest version as of this writing.

Updating PIP for Python 3

By the time you read this article, the version of PIP for Python 3 might change. I am going to show you how to update PIP for Python 3 now.
Open a terminal and run the following command to update PIP for Python 3:

$ pip3 install -U pip

As you can see PIP for Python 3 has been updated.
Now to check the version of PIP for Python 3, run the following command:

$ pip3 --version

Notice any difference? Before I updated PIP for Python 3, the command said PIP was installed in /usr/lib/python3/dist-packages directory. After I upgraded PIP for Python 3, the command now says that PIP is installed on the current user’s home directory. It means the upgrade was successful.
So that’s how you install and update PIP for Python 3 on Ubuntu. Thanks for reading this article.

References

https://linuxhint.com/install-pip-on-ubuntu/

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章