Today, I would like to share a good news with you all. I have recently begun my Python journey. Yes, I know it is late, but I think we can learn at any time we want. Python is currently used in many popular websites and is one of the main language used for Machine Learning. In this article, I would like to share about PIP which is “Python Package Installer“. It is the first thing which you should know if you are starting to learn about Python.
What is Python?
Python is a general purpose and high-level programming language and can be used for developing desktop GUI applications, websites, and web applications.
There are many other important reasons why you should use Python.
What is pip “Python Package Installer”?
Basically, pip which is also called “Python Package Installer” is the preferred installer program and package manager for Python. Starting with Python 3.4, it is included by default with the Python binary installers.
How to Install pip?
Installing pip is very easy!
If you have Python version 2 which is greater or equal to 2.7.9 or Python 3 which is greater or equal to 3.4, then you don’t need to install the pip, it will be installed by default.
Now, let’s see how to install pip on an ubuntu server. Here, first of all, I am downloading get-pip.py script and then will run it using Python.
You can also directly download get-pip.py script and put onto your server.
pawan@ubuntu:~$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 1604k 100 1604k 0 0 1747k 0 --:--:-- --:--:-- --:--:-- 1747k pawan@ubuntu:~$
pawan@ubuntu:~$ sudo python get-pip.py /tmp/tmpkZBgT4/pip.zip/pip/_vendor/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown. Collecting pip Downloading https://files.pythonhosted.org/packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl (1.3MB) 100% |████████████████████████████████| 1.3MB 1.4MB/s Collecting setuptools Downloading https://files.pythonhosted.org/packages/66/e8/570bb5ca88a8bcd2a1db9c6246bb66615750663ffaaeada95b04ffe74e12/setuptools-40.2.0-py2.py3-none-any.whl (568kB) 100% |████████████████████████████████| 573kB 6.6MB/s Collecting wheel Downloading https://files.pythonhosted.org/packages/81/30/e935244ca6165187ae8be876b6316ae201b71485538ffac1d718843025a9/wheel-0.31.1-py2.py3-none-any.whl (41kB) 100% |████████████████████████████████| 51kB 5.5MB/s Installing collected packages: pip, setuptools, wheel Successfully installed pip-18.0 setuptools-40.2.0 wheel-0.31.1 pawan@ubuntu:~$
How to check the version of pip?
You can use the command “pip –version” to check the version of pip.
root@ubuntu:~# pip --version /usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown. warnings.warn(warning, RequestsDependencyWarning) pip 18.0 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)
How to upgrade the version of pip?
You just have to use below command on Linux machine to upgrade the pip (Python Package Installer).
pip install -U pip
Windows users can use below command.
python -m pip install -U pip
If it is already updated, you will see the message “Requirement already up-to-date”.
I think that is pretty much about this basic python tutorial on pip. Hope you enjoyed it.
If you would like to see more basic tutorials on Python and want to learn Python along with me, do let me know through your comments. For email updates, do subscribe to the email newsletter which is completely free of charge.