Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pip, easy_install commands not working in Ubuntu. Python 2.7 and 3.4 are installed

I'm fairly new to python. I'm using Ubuntu 14.04 and have both python 2.7.6 and python 3.4.0 installed. I was trying to install BeautifulSoup but couldn't because I get an error saying

The program 'pip' is currently not installed. 

I found that it comes bundles with python 3.4. I tried to install pip using sudo easy_install pip as mentioned in another question on stackoverflow. But this gives an error sudo: easy_install: command not found.

What is the problem?

like image 983
mahacoder Avatar asked Feb 01 '15 17:02

mahacoder


3 Answers

pip appears to have turned into python -m pip (in your case, python3 -m pip, as Ubuntu's keeping the 2.x line available as python) in Python 3.4.

easy_install for Python 2.7 comes as part of the python-setuptools package. Once installed, running easy_install pip would install pip for your Python 2.7 installation's use.

like image 103
ceejayoz Avatar answered Sep 27 '22 15:09

ceejayoz


How aboutapt-get install python-pip? At least, Debian official repository has python-pip even from wheezy.

like image 26
soundlake Avatar answered Sep 27 '22 16:09

soundlake


Unfortunately, effective as of April 2018, python-setuptools no longer ships with easy_install, as per Matthias's update:

https://ubuntu.pkgs.org/18.04/ubuntu-main-i386/python-setuptools_39.0.1-2_all.deb.html

However, you can still compile from the source code yourself, and it does work. I just tried it with sudo easy_install shodan, and it ran successfully.

git clone https://github.com/pypa/setuptools.git
cd ./setuptools
python3 bootstrap.py
sudo python3 setup.py install

Hope this helps.

like image 40
Kourosh Taheri-Golvarzi Avatar answered Sep 27 '22 17:09

Kourosh Taheri-Golvarzi