【问题标题】:pip install not working, Distribution not foundpip install 不工作,找不到分发
【发布时间】:2020-05-28 08:35:50
【问题描述】:

我正在尝试安装 Pip 和 anaconda。

在我的 mac 中,我既有 python 2 又有 python 3。

当我尝试easy_install pip 时,我收到错误[Errno 13] Permission denied: '/Library/Python/2.7/site-packages/test-easy-install-14341.write-test'

所以我尝试做一个pip install

我知道了

Traceback (most recent call last):
  File "/usr/local/bin/pip", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3241, in <module>
    @_call_aside
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3225, in _call_aside
    f(*args, **kwargs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3254, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 585, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 598, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==19.3.1' distribution was not found and is required by the application

我也无法安装 Anaconda,可能是因为这个问题

PS。我用自制软件安装了python。

有人解决了吗?

【问题讨论】:

  • 你试过这个吗:stackoverflow.com/questions/6200056/…
  • a) easy_install 已弃用。不要使用它,b) Permission denied 是自我描述的——使用sudo。虽然我想你在做某事。一开始就错了
  • 建议 - 严格关注 Python 3。Python 2 已结束生命周期。

标签: python python-3.x pip installation anaconda


【解决方案1】:

其中一个问题是,从现在开始我们将使用pip3 而不仅仅是pip。另一个问题是open ~/.zshrc 文件需要使用来自anaconda 的相同open ~/.bash_profile 指令进行更新。

结论

我认为要安装 pip 包,您需要使用 pip3 命令,或者您可以编写一个别名文件,将 pip 替换为 pip3。

然后为了实际使用conda,我按照这篇文章,使其超出了mac config的zhs。

Getting Anaconda to work

【讨论】:

    猜你喜欢
    • 2014-03-09
    • 2015-01-03
    • 2014-09-04
    • 2013-09-17
    • 2015-11-03
    • 2018-05-25
    • 1970-01-01
    • 2021-07-15
    • 1970-01-01
    相关资源
    最近更新 更多