Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to install pip in ubuntu?

I tried to install pip several times but couldn't. This is how my terminal looks like while trying to install pip:

aman@aman-HP-Pavilion-Notebook:~$ sudo apt-get install python-pip

Reading package lists... Done
Building dependency tree       
Reading state information... Done
python-pip is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

aman@aman-HP-Pavilion-Notebook:~$ pip

The program 'pip' is currently not installed. You can install it by typing:
sudo apt-get install python-pip

aman@aman-HP-Pavilion-Notebook:~$ sudo pip

sudo: pip: command not found

aman@aman-HP-Pavilion-Notebook:~$
like image 846
Aman Kumar Avatar asked Jun 01 '17 00:06

Aman Kumar


People also ask

Why is pip not installed on Ubuntu?

The python-pip package manager works as an independent package manager on Linux distribution. This means you need to install the pip tool separately from python programs. The pip command is not found an error raised on your Linux terminal window if the pip is not installed independently on Ubuntu 20.04 system.

Why is my pip install not working?

This error usually means there's a problem with the Python installation or the system variable PATH is not set up correctly. Try reinstalling Python and all its components to fix the problem. The easiest way is via the Python executable installer.

How to install Pip for Python 3 on Ubuntu?

To install pip for Python 3 on Ubuntu 20.04 run the following commands as root or sudo user in your terminal: sudo apt update sudo apt install python3-pip. Copy. Copy. The command above will also install all the dependencies required for building Python modules.

What is Pip in Python?

What is pip? Pip stands for “Pip Installs Packages”. Pip is a command-line based package management system. It’s used to install and manage software written in the Python language. You can use pip to install packages listed in the Python Package Index ( PyPI ).

How do I use PIP to install a package?

With pip, we can install packages from PyPI, version control, local projects, and from distribution files but in most cases, you will install packages from PyPI. To view the list of all pip commands and options, type: pip3 --help. You can get more information about a specific command using pip <command> --help.

How do I upgrade pip on my Mac?

You should consider upgrading via the 'pip install --upgrade pip' command. _aman@aman-HP-Pavilion-Notebook:~$_ pip --help The program 'pip' is currently not installed. You can install it by typing: sudo apt-get install python-pip _aman@aman-HP-Pavilion-Notebook:~$_ pip install --upgrade pip The program 'pip' is currently not installed.


2 Answers

Try with this commands:

sudo apt-get purge --auto-remove python-pip

sudo apt-get update

sudo apt-get -y install python-pip

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

python get-pip.py

verify:

pip --help

pip -V

The issue might be package available in Ubuntu 14.04 Universe repository.

If that doesn't work, download the .deb from here:

https://packages.ubuntu.com/trusty/all/python-pip/download

and right click on the .deb and install it

like image 186
A Monad is a Monoid Avatar answered Oct 14 '22 02:10

A Monad is a Monoid


the problem is probably you have two versions of python 2 installed on your PC in different locations and pip of one of the copies of python got removed somehow. so when you try to install the pip for a copy, system says that there is a pip already installed in another location and also the /usr/local/bin folder is also missing the pip file used to installed pip.

i just solved this issue so i will try to explain it in a way so that beginners also understand it properly

copy the already installed pip file to the location where it is missing instead of installing it through commands as command will detect the already installed pip.

the solution is very simple:

run these commands in a terminal (command prompt) in Ubuntu

which pip

# to get the location of the pip file already installed

cp location provided by which pip location where to copy pip file

hope it helps.

like image 34
Khan Avatar answered Oct 14 '22 02:10

Khan