Pip: ImportError: Entry point ('console_script

2019-01-26 09:12发布

I install pip with:

$ sudo apt-get install python-setuptools, python-pip

But when I try install something with pip i have this error

sudo pip install Flask
Traceback (most recent call last):
File "/usr/local/bin/pip", line 9, in <module>
  load_entry_point('pip==1.3.1', 'console_scripts', 'pip')()
File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 378, in    load_entry_point
  return get_distribution(dist).load_entry_point(group, name)
File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 2565, in load_entry_point
  raise ImportError("Entry point %r not found" % ((group,name),))
ImportError: Entry point ('console_scripts', 'pip') not found

why?? Thanks.

标签: python pip
3条回答
Lonely孤独者°
2楼-- · 2019-01-26 10:00

I find there are multiple version pip on my Ubuntu,I followed these steps and it worked:

  1. sudo apt-get remove python-pip
  2. sudo rm -rf /usr/local/bin/pip-2.7 sudo rm -rf /usr/local/bin/pip
  3. sudo rm -rf /usr/local/lib/python2.7/dist-packages/pip-1.4.1.egg-info
  4. sudo easy_install -m pip-2.7 sudo easy_install -m pip
  5. curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
  6. sudo python get-pip.py
查看更多
戒情不戒烟
3楼-- · 2019-01-26 10:01

I remove setuptools 0.9.4 and do 'pip install --upgrade setuptools' and work good.

查看更多
唯我独甜
4楼-- · 2019-01-26 10:09

you may check the /usr/bin/pip file, if it links to pip2, then change the first line of pip2 from '/usr/bin/python' to '/usr/bin/python2.7' or '/usr/bin/python2.x' matching pip2. If it links to pip3, then change to python3 or the version python3.x matching pip3.

It works for me because I have installed python 2.7 and 3 so and pip. So when I use 'pip' it using python3 as default, which resulting in the same output.

查看更多
登录 后发表回答