如何为python 2.7安装pip?

我按照链接@
https://linuxize.com/post/how-to-install-pip-on-centos-7/#2-install-pip来安装pip,但是它为系统附带的python 2.6安装了,如何为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

安装点子

 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 7.1.0 from /usr/lib/python2.6/site-packages (python 2.6)

机器配置:

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 /本地

《如何为python 2.7安装pip?》

最佳答案 尝试手动安装:

wget -P ~/.local/lib https://bootstrap.pypa.io/get-pip.py
python2.7 ~/.local/lib/get-pip.py --user 
#if using bash
printf "\nPATH=\$PATH:~/.local/bin/" >> ~/.bashrc
source ~/.bashrc
点赞