用homebrew的python安装问题

时间:2017-11-10 00:13:30

标签: python homebrew

在这里设置一个新的mac。我刚刚使用brew install python安装了python,但是当我尝试使用sudo pip install virtualenv安装virtualenv时,它会返回sudo: pip: command not found

当我尝试sudo easy_install pip时,它会返回以下回复

    Traceback (most recent call last):
    File "/usr/local/bin/easy_install", line 11, in <module>
    load_entry_point('setuptools==33.1.1', 'console_scripts', 'easy_install')()
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 565, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2697, in load_entry_point
    return ep.load()
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2370, in load
    return self.resolve()
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2376, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
    File "build/bdist.macosx-10.12-intel/egg/setuptools/__init__.py", line 10, in <module>
    File "build/bdist.macosx-10.12-intel/egg/setuptools/extern/__init__.py", line 1, in <module>
    ImportError: No module named extern

我无法想象发生了什么,但是对于我的旧安装,我遇到了任何问题。任何帮助都会非常有用......

1 个答案:

答案 0 :(得分:0)

我更新此问题以发布可能的解决方案:

curl https://bootstrap.pypa.io/get-pip.py | sudo python