【问题标题】:Pip can't be run and apt-get command not foundPip 无法运行且找不到 apt-get 命令
【发布时间】:2019-11-12 16:00:43
【问题描述】:

我最近才重新开始学习有关 django 软件的更多信息。它需要我安装一些软件包,但我发现我的 pip 不起作用。所以我想我必须重新安装它或其他东西,因为这之前工作过所以我尝试了 Sudo apt-get --update 但后来我得到了 apt-get 命令未找到的错误。我在互联网上搜索了这个问题的答案,但我还没有找到有这个问题的答案。

这是 pip 给我的错误。

Traceback (most recent call last):
  File "/usr/local/bin/pip", line 5, 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 3095, in <module>
    @_call_aside
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3081, in _call_aside
    f(*args, **kwargs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3108, 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 660, 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 673, 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 846, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==19.0.3' distribution was not found and is required by the application

我已尝试查看是否可以重新安装 sudo 或 pip 但同样的问题。

简单的代码如: apt-get 安装 sudo apt-get 点子

我希望我能得到一个简短的回复,抱怨我没有完成我的行或缺少某些东西,但是 pip 给了我这个奇怪的错误。

【问题讨论】:

标签: pip sudo apt-get


【解决方案1】:

感谢 cmets。这个问题有点复杂,但在检查了问题下的 cmets 后,我设法了解了我的问题。显然我的 pip 缺少 19.0.3 文件,我不得不手动安装它们以获取所需的文件。

easy_install pip==19.0.3

我不得不使用 easy_install 方法绕过 pip 命令。

【讨论】:

    猜你喜欢
    • 2016-01-20
    • 1970-01-01
    • 1970-01-01
    • 2019-05-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-05-08
    • 2016-06-04
    相关资源
    最近更新 更多