简体   繁体   English

导入错误:没有名为 pip.log 的模块——正在使用 pip 安装

[英]ImportError: No module named pip.log -- in installation using pip

I am working on Ubuntu 10.10 and I have installed pip using the following command我正在使用 Ubuntu 10.10,我已经使用以下命令安装了 pip

apt-get install python-pip

However when I try installing any package using pip I get the following error但是,当我尝试使用 pip 安装任何 package 时,出现以下错误

ImportError: No module named pip.log

What has possibly gone wrong here?hon这里可能出了什么问题?亲爱的

I have the same problem on debian squeezy(6.0) which default installation is python 2.6.我在 debian squeezy(6.0) 上遇到了同样的问题,默认安装是 python 2.6。 To reproduce the problem:要重现问题:

  1. Upgrade python to 2.7 from building the source code and installed it in /opt/python.将 python 从构建源代码升级到 2.7,并将其安装在 /opt/python 中。

  2. wget bootstrap.pypa.io/get-pip.py and run get-pip.py . wget bootstrap.pypa.io/get-pip.py并运行get-pip.py The installtion should be successful.安装应该会成功。

  3. run pip and the errors occur.运行pip并出现错误。 ImportError: No module named pip.log . ImportError: No module named pip.log

The steps to solve the problem:解决问题的步骤:

  1. ls -l /usr/bin/pip find the old pip installation location. ls -l /usr/bin/pip找到旧的 pip 安装位置。
  2. rm -rf pip remove the old pip installation. rm -rf pip删除旧的 pip 安装。
  3. reinstall the pip with get-pip.py使用get-pip.py重新安装pip
  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/usr/bin/pip重新链接到新的 pip 安装位置,在我的电脑中是ln -s /opt/python/lib/python2.7/site-packages/pip/__init__.py pip

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM