我在 Ubuntu 12.10 上搞砸了 Python Pip 的系统版本 [英] I screwed up the system version of Python Pip on Ubuntu 12.10
问题描述
我想在我的主要 Python 安装上更新 pip,特别是为了获取 list 命令.其中还包括列表更新功能.
I wanted to update pip on my main install of Python, specifically to get the list command. Which also includes the list- updates capability.
所以我跑了:
sudo pip install --upgrade pip
安装时一切看起来都不错,但后来我去运行 pip 并得到了这个:(如果有帮助,包括安装结束)
All looked good on the install but then I went to run pip and got this: (end of install included if it helps)
Installing pip script to /usr/local/bin
Installing pip-2.7 script to /usr/local/bin
Successfully installed pip
Cleaning up...
tom@tom-sam:~$ pip list -o
bash: /usr/bin/pip: No such file or directory
tom@tom-sam:~$ pip
bash: /usr/bin/pip: No such file or directory
很明显,我很沮丧,因为这是我的系统安装 python.. 我在这里阅读了一些答案,但无法确定最简单的修复方法.
Somewhat obviously I'm hosed since this is my system install of python.. I read a few answers here but have not been able to determine the easiest fix.
推荐答案
我在 linux 上有同样的消息.
I had the same message on linux.
/usr/bin/pip: No such file or directory
但随后检查了调用的是哪个 pip.
but then checked which pip was being called.
$ which pip
/usr/local/bin/pip
在我的 debian wheezy 机器上,我按照以下步骤修复了它...
On my debian wheezy machine I fixed it doing following...
/usr/local/bin/pip uninstall pip
apt-get remove python-pip
apt-get install python-pip
====================================
这是由于使用 apt-get
安装和使用 pip install -U pip
更新的混淆.
====================================
This was due to mixup installing with apt-get
and updating with pip install -U pip
.
这些还在 2 个不同的地方安装了库,这给我带来了问题.
These also installed libraries at 2 different places which caused problems for me.
/usr/lib/python2.7/dist-packages
/usr/local/lib/python2.7/dist-packages
这篇关于我在 Ubuntu 12.10 上搞砸了 Python Pip 的系统版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!