Centos:无法安装pip

问题描述 投票:1回答:2

我对python完全不熟悉,所以我不知道这里发生了什么。

当我做

which pip
/usr/bin/which: no pip in (/usr/local/bin/python:/usr/bin/python2:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)

然后安装pip,当我这样做

sudo yum install python-pip

我明白了

Loaded plugins: fastestmirror, versionlock
Loading mirror speeds from cached hostfile
 * base: centos.myfahim.com
 * epel: kartolo.sby.datautama.net.id
 * extras: centos.myfahim.com
 * updates: centos.myfahim.com
Package python2-pip-8.1.2-5.el7.noarch already installed and latest version
Nothing to do

有人可以请帮助。这非常令人沮丧。

PS:这是我的python细节which python / usr / local / bin / python

python --version

Python 2.6.6

python pip python-install
2个回答
2
投票

python2-pip RPM包含:

/usr/bin/pip
/usr/bin/pip2
/usr/bin/pip2.7

pip似乎没有/usr/bin时,请查看:

rpm -qV python2-pip

丢失文件并在必要时重新安装RPM:

yum reinstall python2-pip

(假设启用了epel存储库。)


0
投票

环境变量PATH可能存在问题。你可以再试一次:

whereis pip
sudo updatedb
locate pip

也看看

env | grep -i PATH

或者再次尝试安装pip(再次)

#adding epel repository https://wiki.centos.org/AdditionalResources/Repositories

yum -y update #it will update your repo package references
yum -y install python-pip # -y parameter says yes 
© www.soinside.com 2019 - 2024. All rights reserved.