【问题标题】:No module named 'pkg_resources' when certbot -vcertbot -v 时没有名为“pkg_resources”的模块
【发布时间】:2021-08-22 03:00:33
【问题描述】:

我正在尝试使用 certbot,当我输入 certbot -v(或任何 certbot 命令)时,我得到了这个:

Traceback (most recent call last):
  File "/usr/local/bin/certbot", line 6, in <module>
    from pkg_resources import load_entry_point
ModuleNotFoundError: No module named 'pkg_resources'

好的...我卸载 python。安装了python3。我安装了 setuptools 并在 /usr/local/lib/python3.8/dist-packages 中看到它

它发生在我将我的 ubuntu 更新到 20.04 之后 我尝试了所有建议,但没有任何效果。我该如何解决这个问题?

【问题讨论】:

  • 我相信你在正确的轨道上,这意味着你的 python 环境存在问题,它与setuptools 有关,因为通常pkg_resourcessetuptools 一起分发。请检查此答案,看看它是否对您有用。 stackoverflow.com/questions/7446187/…
  • 谢谢迈克。我确实尝试了所有建议,但对我没有用。不过我找到了解决方法。

标签: python package certbot


【解决方案1】:

所以...实际上对我有用的是:

卷曲 -o- https://raw.githubusercontent.com/vinyll/certbot-install/master/install.sh |重击

因为我有 Ubuntu 20.04 certibot 有点敏感。 该命令正确安装了 python 包。

非常感谢

【讨论】:

    猜你喜欢
    • 2011-11-18
    • 2017-09-26
    • 2020-05-09
    • 2020-07-28
    • 1970-01-01
    • 2015-10-04
    • 2020-03-20
    • 2014-04-04
    相关资源
    最近更新 更多