osx sierra没有名为pip的模块

时间:2017-11-01 15:37:25

标签: python macos python-2.7 pip

我最近升级到sierra(10.13)并且pip不再工作了,任何时候我尝试安装我得到的软件包'没有名为pip的模块'

 pip install setuptools

 Traceback (most recent call last):


File "/usr/local/bin/pip", line 9, in <module>
    load_entry_point('pip==9.0.1', 'console_scripts', 'pip')()
  File "/Library/Python/2.7/site-packages/pkg_resources/__init__.py", line 542, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/Library/Python/2.7/site-packages/pkg_resources/__init__.py", line 2569, in load_entry_point
    return ep.load()
  File "/Library/Python/2.7/site-packages/pkg_resources/__init__.py", line 2229, in load
    return self.resolve()
File "/Library/Python/2.7/site-packages/pkg_resources/__init__.py", line 2235, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
ImportError: No module named pip

但是,如果我键入&#39;哪个pip&#39;:

 /usr/local/bin/pip

我已经尝试过重新安装python&#39;

我已经尝试下载get-pip.py并重新安装

我已经尝试了#python easy_install pip&#39;

我确定我的环境路径是正确的,并且回应$ PATH&#39;:

/usr/local/bin:/usr/local/sbin/....

1 个答案:

答案 0 :(得分:1)

显然有些链接已损坏,所以我做了

 brew unlink python && brew link python

当被问到我移除了轮子时,请从/ usr / local / bin

希望它有所帮助。