程序已卸载但仍然出现错误:ContextualVersionConflict

程序已卸载但仍然出现错误:ContextualVersionConflict

我使用 ubuntu 18.04。我最近安装了 certbot 来创建 SSH,它工作正常。然后我决定安装python-pipcertbot-dns-cloudflare使用此命令

sudo apt install python-pip
sudo pip install certbot-dns-cloudflare

安装后,运行时certbot总是出现错误

An unexpected error occurred:
ContextualVersionConflict: (cryptography 2.1.4 (/usr/lib/python2.7/dist-packages), Requirement.parse('cryptography>=2.2.1'), set(['PyOpenSSL']))
Please see the logfile '/tmp/tmpg0HmH3' for more details.

日志文件输出:

2019-01-08 01:54:07,629:DEBUG:certbot.log:Exiting abnormally:
Traceback (most recent call last):
  File "/usr/local/bin/certbot", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/certbot/main.py", line 1334, in main
    plugins = plugins_disco.PluginsRegistry.find_all()
  File "/usr/local/lib/python2.7/dist-packages/certbot/plugins/disco.py", line 206, in find_all
    plugin_ep = PluginEntryPoint(entry_point)
  File "/usr/local/lib/python2.7/dist-packages/certbot/plugins/disco.py", line 52, in __init__
    self.plugin_cls = entry_point.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2323, in load
    self.require(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2346, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 783, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
ContextualVersionConflict: (cryptography 2.1.4 (/usr/lib/python2.7/dist-packages), Requirement.parse('cryptography>=2.2.1'), set(['PyOpenSSL']))
2019-01-08 01:54:07,629:ERROR:certbot.log:An unexpected error occurred:

即使我卸载python-pip certbot-dns-cloudflarecertbot使用

sudo pip uninstall certbot-dns-cloudflare
sudo apt remove python-pip
sudo apt remove certbot

我仍然收到同样的错误,它不应该告诉我该程序未安装吗?

答案1

我遇到了同样的问题,并按照发布的解决方案进行了修复这里

“密码学”必须升级。我用

pip install cryptography --upgrade

并更新了软件包,然后所有 Certbot 命令都正常工作!

相关内容