Certbot broke afther server update and upgrade

I ran this command: sudo certbot or sudo certbot --help

It produced this output:

Traceback (most recent call last):
  File "/usr/bin/certbot", line 11, in <module>
    load_entry_point('certbot==0.19.0', 'console_scripts', 'certbot')()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 561, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2631, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2291, in load
    return self.resolve()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2297, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python2.7/dist-packages/certbot/main.py", line 11, in <module>
    from acme import jose
ImportError: cannot import name jose

My web server is : Debian 9.5 (stretch) and Apache2.4

I can login to a root shell on my machine (yes or no, or I don’t know): yes

Hi @bossfight,

As you are using certbot version 0.19.0 in Debian Stretch I suppose you installed it using stretch-backports, if that is the case install these packages from backports:

apt -t stretch-backports install python-certbot-apache python-acme certbot

Edit: @mnordhoff pointed that right now certbot uses python3 so the right command should be:

apt -t stretch-backports install python3-certbot-apache python3-acme certbot

Cheers,
sahsanu

Doesn’t stretch-backports have version 0.25.0 now? And it uses Python 3, not Python 2.

2 Likes

@mnordhoff, you are right, thank you.

@bossfight, the right command should be:

apt -t stretch-backports install python3-certbot-apache python3-acme certbot

1 Like

Thanks guys work like a charm. :star_struck:

@sahsanu yes, using stretch-backports installation thank you for the advice
@mnordhoff Congratulations, all renewals succeeded. :+1:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.