0

OK so I am a total noob and I just installed Kali Linux. I am trying to install python-pip by command

apt-get install python-pip

and I am getting this output

  Reading package lists... Done
  Building dependency tree       
  Reading state information... Done
  E: Unable to locate package python-pip

I've checked my source /ect/apt/sources.list and it says

deb http://http.kali.org/kali kali-last-snapshot main non-free contrib

I've run apt-get updates several times too and it's not helping. Please help.

2
  • 1
    what is the output when you just type python
    – Sven
    Apr 21, 2020 at 12:36
  • It says python 2.7.18rc1 (default date and time) Apr 21, 2020 at 12:42

19 Answers 19

3

At-First Open Your sources.list File With any Editor.

nano /etc/apt/sources.list

and add these Lines.

deb http://http.kali.org/kali kali-rolling main non-free contrib 
deb-src http://http.kali.org/kali kali-rolling main non-free contrib

Not Update and Upgrade Your Kali Linux Using These Commands.

apt-get update
apt-get upgrade

and then Install pip using this command

apt-get install python-pip   #For Python2
apt-get install python3-pip  #For Python3
3

There is a high chance python-pip is not available, because 'python' is python2, and python2 is finally dead. Try to install python3-pip.

There is a convention that python without '3' is python2, and it's gonna last like that, I think, forever, due to compatibility reasons.

1
  • I've already installed Python3-pip and it is the latest version. The problem is I am installing nuriyadin/InstaBurst and during the sudo ./install.sh it keeps saying Unable to locate python-pip pip command not found and some other packages by glob 'php7.0-cgi' and regex 'php7.0-cgi' and the installation fails. Apr 21, 2020 at 12:41
2
cd /
cd etc/apt/
sudo nano sources.list

After opening the editor paste the following line if not present.

deb http://http.debian.net/debian jessie-backports main
deb http://http.kali.org/kali kali-rolling main contrib non-free

run the following command

sudo apt upgrade
sudo apt install python-pip

This should work for you.

1

Try running apt-get install python3-pip. This will install pip3 on your machine.

2
  • I've already installed Python3-pip and it is the latest version. The problem is I am installing nuriyadin/InstaBurst and during the sudo ./install.sh it keeps saying Unable to locate python-pip pip command not found and some other packages by glob 'php7.0-cgi' and regex 'php7.0-cgi' and the installation fails. Apr 21, 2020 at 12:41
  • At minimum you may try to cheat them (alias pip=pip3), but if they are insisting on using python2, than they use unsupported python version. If you want, you can install python and pip by yourself (manual compilation, a lot of grind and hard work). Basically, python2 is DEAD, and no reasonable amount of efforts would revive it. (Or you can boot VM with old distro and use it - f.e. Ubuntu 18.04 would support python for few more years). Apr 21, 2020 at 13:38
1

I tried with sudo apt install python3-pip and didn't work. So I tried again with sudo apt-get install python3-pip and it worked fine. I'm using Kali Linux too. img

1

You need to add the repositories to sources.list

nano /etc/apt/sources.list

And add

deb http://http.kali.org/kali kali-rolling main non-free contrib
deb-src http://http.kali.org/kali kali-rolling main non-free contrib

Save and run

apt-get update
apt-get upgrade 
apt-get install python-pip #or python3-pip

And type

pip --version #or pip3

To more info click here and here

1

Use this to install pip for python 2.7:

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

Now you have:

$ pip --version    
pip 20.3.4 from /home/kali/.local/lib/python2.7/site-packages/pip (python 2.7)

$ pip3 --version
pip 21.0.1 from /home/kali/.local/lib/python3.9/site-packages/pip (python 3.9)
1
  • That link was broken. So I google dorked 'site:bootstrap.pypa.io get-pip.py' and found a good url: bootstrap.pypa.io/pip/2.7/get-pip.py. That allows me to do python -m pip [command] but pip --version still says 3.x. May 31, 2021 at 1:26
0
sudo apt update       
sudo apt install python3   
sudo apt install python3-pip  
python3 -m pip install -r 

This video helped me: https://www.youtube.com/watch?v=9EHUGDnvqoA

0

Try following commands:

sudo apt-get install software-properties-common
sudo apt-add-repository universe
sudo apt-get update
sudo apt-get install python-pip

Hope it will help u!

0

Make your source.list like this

nano /etc/apt/source.list

deb http://http.kali.org/kali kali-last-snapshot main non-free contrib
deb http://http.kali.org/kali kali-rolling main non-free contrib deb-src
http://http.kali.org/kali kali-rolling main non-free contrib    

Update Your kali

sudo apt-get update && upgrade

Now install python-pip

apt-get install python-pip or apt-get install python3-pip
1
  • This looks basically the same as a number of other answers. You should probably clarify what the differences are and why they're different, or you should delete it since it's superfluous
    – DavidW
    Jan 3, 2021 at 11:06
0

It works for me:

curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py && python get-pip.py
0

If already python 2.7 version is installed , first remove that in cmd terminal

Type >> sudo apt purge -y python2-minimal

then install python latest version

Type >> sudo apt install -y python3-pip

python is installed!

0

Not found pip try this command 1: sudo apt install python3-pip 2: pip3 install -r requirements.txt 3: /usr/local/bin/python3.10 -m pip install --upgrade pip

1
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Jan 2, 2022 at 12:31
0

i have same issue that i was using python2 not python3 you may check your python version you have

0

None of these seemed to work for me as it had some unmet dependencies. This is what fixed it for me (commands in the terminal).

sudo apt-get update

apt-get install libjs-mathjax fonts-mathjax

sudo apt-get intall python3-pip
0

you can install pip using the get-pip.py script provided by the Python Packaging Authority.

get-pip.py

This is a Python script that uses some bootstrapping logic to install pip.

1-Download the script, from https://bootstrap.pypa.io/get-pip.py. by typing the command:

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

2-Open a terminal/command prompt, cd to the folder containing the get-pip.py file and run:

sudo python3 get-pip.py

Make sure to use python3 instead of python to install pip for Python 3.

3-After the installation is complete, verify pip by running the following command:

pip3 --version
-1

apt-get update apt-get upgrade

This works

-2

Try this :

sudo apt update

sudo apt install python3

sudo apt install python3-pip

python3 -m pip install -r

1
  • Downvoted because it's the same as another answer - it adds nothing
    – DavidW
    Dec 26, 2020 at 22:01
-3

I had the same issue, here is the command that helped me:

sudo apt install python-pip

This command will install pip to your system.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.