ImportError: No module named pip.log — in installa

2019-05-24 10:21发布

问题:

I am working on Ubuntu 10.10 and I have installed pip using the following command

apt-get install python-pip

However when I try installing any package using pip I get the following error

ImportError: No module named pip.log

What has possibly gone wrong here?hon

回答1:

I have the same problem on debian squeezy(6.0) which default installation is python 2.6. To reproduce the problem:

  1. Upgrade python to 2.7 from building the source code and installed it in /opt/python.

  2. wget bootstrap.pypa.io/get-pip.py and run get-pip.py. The installtion should be successful.

  3. run pip and the errors occur. ImportError: No module named pip.log.

The steps to solve the problem:

  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


标签: python pip