Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to install pip for python 2.7?

Tags:

python

pip

centos

I followed the link @https://linuxize.com/post/how-to-install-pip-on-centos-7/#2-install-pip to install pip ,however its intalled for python 2.6 that comes with the system,how do I install it for python 2.7?

sudo yum install epel-release
Loaded plugins: security
Setting up Install Process
Package epel-release-6-8.noarch already installed and latest version
Nothing to do

Installing pip

 sudo yum install python-pip
Loaded plugins: security
Setting up Install Process
Package python-pip-7.1.0-1.el6.noarch already installed and latest version
Nothing to do

pip version

pip --version
pip 7.1.0 from /usr/lib/python2.6/site-packages (python 2.6)

Machine configuration:

LSB Version:    :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: OracleServer
Description:    Oracle Linux Server release 6.6
Release:    6.6
Codename:   n/a

/usr/local

enter image description here

like image 563
user3508811 Avatar asked Jan 20 '19 01:01

user3508811


People also ask

Does Python 2.7 16 have pip?

Python 2.7 must be having pip pre-installed. Try installing your package by: Open cmd as admin.

Does Python 2.7 5 have pip?

pip no longer supports Python 2.7. 5. You need to upgrade to a newer version of Python (2.7. 9 or later for now, but pip will drop support for Python 2 early in 2021).


1 Answers

Try installing manually:

wget -P ~/.local/lib https://bootstrap.pypa.io/pip/2.7/get-pip.py
python2.7 ~/.local/lib/get-pip.py --user 
#if using bash
printf "\nPATH=\$PATH:~/.local/bin/" >> ~/.bashrc
source ~/.bashrc
like image 58
ErikWi Avatar answered Nov 15 '22 04:11

ErikWi