ImportError:没有名为pip.log的模块-使用pip安装
我正在Ubuntu 10.10上工作,并且已使用以下命令安装了pip
I am working on Ubuntu 10.10 and I have installed pip using the following command
apt-get install python-pip
但是,当我尝试使用pip安装任何软件包时,出现以下错误
However when I try installing any package using pip I get the following error
ImportError: No module named pip.log
这里可能出了什么问题?hon
What has possibly gone wrong here?hon
在debian squeezy(6.0)上我有相同的问题,默认安装是python 2.6.重现该问题:
I have the same problem on debian squeezy(6.0) which default installation is python 2.6. To reproduce the problem:
-
将python从构建源代码升级到2.7并将其安装在/opt/python中.
Upgrade python to 2.7 from building the source code and installed it in /opt/python.
wget bootstrap.pypa.io/get-pip.py
并运行get-pip.py
.安装应该成功.
wget bootstrap.pypa.io/get-pip.py
and run get-pip.py
. The installtion should be successful.
运行pip
并发生错误. ImportError: No module named pip.log
.
解决问题的步骤:
-
ls -l /usr/bin/pip
找到旧的pip安装位置. -
rm -rf pip
删除旧的pip安装. - 用
get-pip.py
重新安装pip
- 将
/usr/bin/pip
重新链接到新的pip安装位置,该位置在我的计算机中为ln -s /opt/python/lib/python2.7/site-packages/pip/__init__.py pip
-
ls -l /usr/bin/pip
find the old pip installation location. -
rm -rf pip
remove the old pip installation. - reinstall the
pip
withget-pip.py
- relink the
/usr/bin/pip
to the new pip installation location which in my computer isln -s /opt/python/lib/python2.7/site-packages/pip/__init__.py pip