python – 在homebrew中更新pip和setuptools不起作用

在brew安装 python之后,出现以下内容

Pip and setuptools have been installed. To update them
  pip2 install --upgrade pip setuptools

运行pip2安装

pip2 install --upgrade pip setuptools
Traceback (most recent call last):
  File "/usr/local/bin/pip2",line 11,in <module>
    load_entry_point('pip==9.0.1','console_scripts','pip2')()
  File "/Users/user1/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py",line 564,in load_entry_point
    return get_distribution(dist).load_entry_point(group,name)
  File "/Users/user1/Library/Python/2.7/lib/python/site-packages/pkg_resources/__init__.py",line 2661,in load_entry_point
    raise ImportError("Entry point %r not found" % ((group,name),))
ImportError: Entry point ('console_scripts','pip2') not found

解决方法

在使用Homebrew从Python 2.7.13升级到2.7.14后,我遇到了这个问题.我在GitHub: https://github.com/pyenv/pyenv/issues/739上使用了本期中的建议,它对我有用.我运行的实际命令是:

/usr/local/Cellar/python/2.7.14/bin/python2 -m pip install –upgrade –force-reinstall pip

祝好运.

相关文章

最近做自动化测试时,深感自己对前端涉猎太少,加上对这块比...
homebrew本身就是一个git仓库。使用homebrew安装软件包时,会...
一、Homebrew安装、卸载等命令Homebrew的安装和卸载都非常简...
在mac系统中,使用homebrew可以很方便的管理包。按照官网的说...
我按照说明从这里使用brew安装mysqlhttps://gist.github.com...
我在macOS10.12.4上安装了nginx1.10.3和php5.5.38作为开发服...