ImportError:没有名为pip.log的模块-使用pip安装

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:

  1. 将python从构建源代码升级到2.7并将其安装在/opt/python中.

  1. 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.

解决问题的步骤:

  1. ls -l /usr/bin/pip找到旧的pip安装位置.
  2. rm -rf pip删除旧的pip安装.
  3. get-pip.py重新安装pip
  4. /usr/bin/pip重新链接到新的pip安装位置,该位置在我的计算机中为ln -s /opt/python/lib/python2.7/site-packages/pip/__init__.py pip
  1. ls -l /usr/bin/pip find the old pip installation location.
  2. rm -rf pip remove the old pip installation.
  3. reinstall the pip with get-pip.py
  4. relink the /usr/bin/pip to the new pip installation location which in my computer is ln -s /opt/python/lib/python2.7/site-packages/pip/__init__.py pip