0%

python pip执行错误

ImportError: cannot import name IncompleteRead

pip -h
ImportError: cannot import name IncompleteRead

pip出现问题,执行修复:

sudo apt-get remove python-pip
sudo apt-get install python-pip

没有解决问题,尝试另一种:

sudo easy_install pip

解决此问题

ImportError: No module named ‘pip’

Pip则是一种更为高级的安装工具,它依赖于Setuptools

pip list
Traceback (most recent call last):
File "/usr/local/bin/pip", line 9, in <module>
load_entry_point('pip==1.4.1', 'console_scripts', 'pip')()
File "/usr/local/lib/python3.4/dist-packages/setuptools-1.1.5-py3.4.egg /pkg_resources.py", line 357, in load_entry_point
def get_entry_info(dist, group, name):
File "/usr/local/lib/python3.4/dist-packages/setuptools-1.1.5-py3.4.egg/pkg_resources.py", line 2394, in load_entry_point
break
File "/usr/local/lib/python3.4/dist-packages/setuptools-1.1.5-py3.4.egg/pkg_resources.py", line 2108, in load
name = some.module:some.attr [extra1,extra2]
ImportError: No module named 'pip'

$ which pip
/usr/local/bin/pip

$ python2.7 -m pip //here can be just python, btw
Usage:   
/usr/bin/python2.7 -m pip <command> [options]
//and so on...

$ python3.4 -m pip
/usr/bin/python3.4: No module named pip

需要安装python3.4下的pip

$ curl https://bootstrap.pypa.io/get-pip.py | python3.4
$ python{2.7,3.4} -m pip install -U setuptools

然后执行

pip list
pip install pyinstaller

均正确,解决此问题