Cannot install python-pip on Kali Linux - python

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.

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

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.

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.

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

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.

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

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)

apt-get update
apt-get upgrade
This works

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

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!

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

It works for me:
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py && python get-pip.py

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!

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

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

Try this :
sudo apt update
sudo apt install python3
sudo apt install python3-pip
python3 -m pip install -r

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.

Related

Remove pip and then install pip3 in python3.x

I have made a mistake.
I have following this instructions.
Now i want to remove pip and then reinstall pip3.
If you are using Ubuntu, why not just use apt or apt-get?
sudo apt-get install python3-pip - to install pip3
sudo apt-get remove python3-pip- to remove pip
Assuming you installed pip for python3, not python.
Edit:
You should specify if you installed pip using Linux package manager or using script (get-pip.py)
Solution:
you need to execute the following command to install pip sudo apt-get
install python3-pip
and to remove you need to use sudo apt-get --purge autoremove
python3-pip

Not able to install python-pip in kali linux 2019.3 vbox amd 64 with apt-get install python-pip

root#kali:~# apt-get install python-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python-pip
I tried updating my source file with the following commands:
leafpad /etc/apt/sources.list
Remove everything and passed the following lines:
deb http://http.kali.org/kali kali-rolling main contrib non-free
deb-src http://http.kali.org/kali kali-rolling main non-free contrib
Save and quit then did
apt-get update
apt-get update --fix-missing
apt autoremove
then
apt-get update
apt-get install python-pip
I still get the same issue
It is better to install it manually.
wget https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
Remeber to check the python version with python --version to check if that's the one you want. If it prints 2.7 and you want Python 3, your command may be python3

Unable to install `gattlib`

I am trying to install gattlib in Python in order to use some of its Bluetooth-tools.
The OS is ubuntu 18.04.4 LTS.
I have by now tried the following (as e.g. here):
sudo apt-get install mercurial
hg clone https://bitbucket.org/OscarAcena/pygattlib
cd pygattlib
cat DEPENDS
sudo apt-get install libboost-thread-dev libboost-python-dev libbluetooth-dev libglib2.0-dev python-dev
sudo python3 setup.py install
which gives (my Python is 3.6.9):
usr/bin/ld: cannot find -lboost-python36
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-g++' failed with exit status 1
Also, I tried:
sudo apt install python3-gattlib
which gives:
the following packages have unmet dependencies:
python3-gattlib: Depends: python3 (>= 3.7~) but 3.6.7-1~18.04 is to be installed
Depends: libboost-python1.67.0 but is is not installable
Depends: libboost-thread1.67.0 but is is not installable
despite libboost-python and libboost-thread being successfully installed in the first attempt (see above), and python3 returning Python 3.6.9.
pip3 install gattlib
shows:
Building wheel for gattlib(setup.py) ... error
Running setup.py install for gattlib ... error
Which is the exact same result that I get from (following instructions from this question):
sudo pip3 download gattlib
sudo tar xvzf ./gattlib-0.20200122.tar.gz
cd gattlib-0.20200122/
sudo sed -ie 's/boost_python-py34/boost_python36/' setup.py
pip3 install .
in which I understand to be a necessary adjustment of the installation file before running it, because, if I understood correctly, the python version is somehow wrongly hardcoded in there.
Futher things I tried and that did not help:
pip3 install --upgrade setuptools
sudo apt-get install python3.6-dev libmysqlclient-dev
sudo apt-get install libmysqlclient-dev
sudo apt-get install python-dev
sudo apt-get install libpython-dev
sudo apt-get install libevent-dev
sudo pip3 install gattlib
wget -qO- http://pike.esi.uclm.es/add-pike-repo.sh | sudo sh
sudo apt update
sudo apt install python3-gattlib
sudo apt-get install libbluetooth-dev
pip3 install --upgrade pip
sudo apt-get install mercurial
pip3 install gattlib
sudo apt-get install libboost-all-dev
cd /usr/lib/x86-64-linux-gnu
sudo ln -s libboost_python-py35.so libboost_python-py36.so
sudo apt-get install libbluetooth-dev bluez bluez-hcidump libboost-python-dev libboost-thread-dev libglib2.0-dev
hg clone https://bitbucket.org/OscarAcena/pygattlib
cd pygattlib
cat DEPENDS
sudo apt-get install libboost-thread-dev libboost-python-dev libbluetooth-dev libglib2.0-dev python-dev
sudo python3 setup.py install
sudo python setup.py install
pip3 install gTTS
sudo apt-get install python3 python-dev python3-dev \
build-essential libssl-dev libffi-dev \
libxml2-dev libxslt1-dev zlib1g-dev \
python-pip
sudo apt-get install aptitude
sudo aptitude install libboost-all-dev
I run
sudo python3 setup.py install
and I also get error
usr/bin/ld: cannot find -lboost-python36
because I don't have boost-python36.a but boost-python3-py36.a.
(I found this file using locate boost-python3 which uses database with filenames so it works faster then find but it may not be installed as default)
I had to edit setup.py and change
boost_libs = ["boost_python3"+str(sys.version_info.minor)]
to
boost_libs = ["boost_python3-py36"]
or more universal
boost_libs = ["boost_python3-py3"+str(sys.version_info.minor)]
Tested od Linux Mint 19.3 Tricia based on Ubuntu 18.04
You need to install python-dev that contains the header files for the Python C API. The following should do the trick (make sure to replace X with your Python version):
sudo apt-get install python3.X-dev
With ubuntu 20.04:
$ wget https://github.com/oscaracena/pygattlib/releases/download/v.20201113/python3-gattlib_0.20201113-1_amd64.deb
$ sudo apt install ./python3-gattlib*.deb
$ pip3 install gattlib
Reference:
https://pypi.org/project/gattlib/
NOTE: This didn't work for me!
sudo apt install pkg-config libboost-python-dev libboost-thread-dev libbluetooth-dev libglib2.0-dev python-dev

How to install pip for python3.7 only?

I have python3.7 and I want to install pip. However when I do the following:
sudo apt install python3-pip
It seems to download python version 3.6 and pip for that. Is there a way to not download python3.6 and just download pip for python3.7? It seems rather strange that pip is download a whole other package.
Download get-pip file
$curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
Install pip for python3.7
$python3.7 get-pip.py
Check versions for both
$python3.7 -V && pip3 -V
Output:
Python 3.7.3
pip 19.1.1 from /usr/local/lib/python3.7/dist-packages/pip (python 3.7)
if you check apt show python3-pip output you see it depends on python3:any (>= 3.4~) so it doesn't strictly say I need python3.6
I assume that you didn't install python3.7 using apt so as a result apt doesn't recognize that you have python3 and it tries to install it for you.
Deadsnakes
You can use a ppa called deadsnakes.
sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.7
Then check that is has been installed successfully by running python3.7 --version. To use pip you can run python3.7 -m pip install package.
Compiling from source
You can build Python by yourself, on Debian based systems you would do:
sudo apt-get update; sudo apt-get install make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
Download your preferred python version from https://www.python.org/ftp/python/
Then extract the tar archive and run make
./configure --enable-optimizations
make
sudo make altinstall
Then run python3.7 --version
try this.
python3.7 -m pip install pip

Pygame on Ubuntu Python 3

I have searched everywhere. There is no answer for my specific problem! I have Ubuntu, I want to use pygame on Python 3. I installed the pygame package with
sudo apt-get python-pygame
but it just doesn't work when I type
import pygame
Please help!
You must install pip for python3
$ sudo apt install python3-pip
and then, with the pip installed, install pygame
$ pip3 install pygame
Ubuntu 19.04 and later
To install python3-pygame in Ubuntu 19.04 and later open the terminal and type:
sudo apt install python3-pygame
Ubuntu 18.10
To install python3-pygame in Ubuntu 18.10 open the terminal and type:
sudo nano /etc/apt/sources.list
Add this line to sources.list.
deb http://archive.ubuntu.com/ubuntu/ cosmic-proposed universe
Save sources.list with the keyboard combination Ctrl+O and press Enter and exit with Ctrl+X
Update the list of available software and install python3-pygame.
sudo apt update
sudo apt install python3-pygame
Ubuntu 16.04-18.04
sudo apt install python3-setuptools
sudo easy_install3 pip
python3 -m pip install --user pygame
The pygame package on Ubuntu is only for python 2.7, so it is impossible to import if you use python 3. If you want python 3.x support, you need to install pygame 1.9.2 which is located at https://bitbucket.org/pygame/pygame/downloads
If you have all the dependencies installed, it should be as simple as running setup.py
I'm at a Pop-OS 20.04 machine and all of those answers didn't work for me (◉_◉). So I went to the documentation of Pygame and realized that I had to have the dependencies installed. To do that you can:
sudo apt-get install git python3-dev python3-setuptools python3-numpy python3-opengl \
libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsmpeg-dev \
libsdl1.2-dev libportmidi-dev libswscale-dev libavformat-dev libavcodec-dev \
libtiff5-dev libx11-6 libx11-dev fluid-soundfont-gm timgm6mb-soundfont \
xfonts-base xfonts-100dpi xfonts-75dpi xfonts-cyrillic fontconfig fonts-freefont-ttf libfreetype6-dev
Now you are ready to install Pygame, so git clone their GitHub repository into your current folder and pip install the module:
git clone https://github.com/pygame/pygame.git
If you are using Python 2 go to this URL: https://www.pygame.org/wiki/CompileUbuntu?parent=

Categories

Resources