• Contact Us
  • copyright
  • About Us
  • Privacy Policy
  • Devops
  • Linux
Globedrill

pip command not found. How to install pip with get-pip.py

Linux/08 Dec, 19/1228/0
Linux

bash: pip: command not found. How to install pip with get-pip.py

 

I got the error ‘pip command not found’ on my Linux server.

1. Log into you Linux server as root or sudo user

First you must log into your Linux server as ‘root’ user or as user with sudo privilege to install pip.

 
2. Download ‘get-pip.py’ file

You can download get-pip.py file from the website pip.pypa.io using curl or wget command.

Command :

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py

 

# 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 1734k 100 1734k 0 0 545k 0 0:00:03 0:00:03 –:–:– 545k

 
 
3. Run ‘python get-pip.py’ command to install pip

get-pip.py will install pip, setuptools and wheel

 

# python get-pip.py

Downloading https://files.pythonhosted.org/packages/00/b6/9cfa56b4081ad13874b0c6f96af8ce16cfbc1cb06bedf8e9164ce5551ec1/pip-19.3.1-py2.py3-none-any.whl (1.4MB)
|################################| 1.4MB 544kB/s
Collecting setuptools
Downloading https://files.pythonhosted.org/packages/54/28/c45d8b54c1339f9644b87663945e54a8503cfef59cf0f65b3ff5dd17cf64/setuptools-42.0.2-py2.py3-none-any.whl (583kB)
|################################| 583kB 5.8MB/s
Collecting wheel
Downloading https://files.pythonhosted.org/packages/00/83/b4a77d044e78ad1a45610eb88f745be2fd2c6d658f9798a15e384b7d57c9/wheel-0.33.6-py2.py3-none-any.whl
Installing collected packages: pip, setuptools, wheel
Successfully installed pip-19.3.1 setuptools-42.0.2 wheel-0.33.6

 

Use ‘--no-setuptools’ option with get-pip.py, if you do not want to install setuptools with pip.

Use ‘--no-wheel’ option with get-pip if you want to skip wheel installation while installing pip.

Now pip is installed on your Linux server.

4. Run the command ‘pip –version’ to check the version of pip installed.
 

#pip –version
pip 9.0.2 from /usr/local/lib/python2.7/dist-packages (python 2.7)

 
 

How to install specific version of pip

 
1. Log into your Linux server via SSH as ‘root’

2. Specify pip version number with get-pip command

Run the below command to install pip version 19.3.1

Example :
 

# python get-pip.py pip==19.3.1

Collecting pip==19.3.1
Using cached https://files.pythonhosted.org/packages/00/b6/9cfa56b4081ad13874b0c6f96af8ce16cfbc1cb06bedf8e9164ce5551ec1/pip-19.3.1-py2.py3-none-any.whl
Installing collected packages: pip
Successfully installed pip-19.3.1

 

Leave a Reply Cancel reply

.

About Us

Globedrill.com is a website that publishes articles related to Linux and Devops. Globedrill was started on April 2016.

Contact Us

Email : globedrill.c@gmail.com

Globedrill

Copyright © 2016 Globedrill. All Rights Reserved. The content in this website is copyrighted to Globedrill.com and may not be republished either online or offline.

  • About Us
  • Privacy Policy
  • Contact Us
  • copyright