Certbot error: cannot import name _remove_dead_weakref

I try to renew the certificate and i have this message:

sudo /var/opt/letsencrypt/letsencrypt-auto renew
Error: couldn’t get currently installed version for /opt/eff.org/certbot/venv/bin/letsencrypt:
Traceback (most recent call last):
File “/opt/eff.org/certbot/venv/bin/letsencrypt”, line 7, in
from certbot.main import main
File “/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot/main.py”, line 6, in
import logging.handlers
File “/usr/lib/python2.7/logging/init.py”, line 26, in
import sys, os, time, cStringIO, traceback, warnings, weakref, collections
File “/usr/lib/python2.7/weakref.py”, line 14, in
from _weakref import (
ImportError: cannot import name _remove_dead_weakref

the procedure is automatic each wee. It’s a bash running on Raspbian Buster.

Thanks to tell me what i should do to solve the problem.

1 Like

A first debugging step can be to try and recreate the virtual environment used by letsencrypt-auto.

You can do this by simply deleting it:

sudo rm -rf /opt/off.org/certbot

When you run letsencrypt-auto again, it will recreate the virtual environment and hopefully resolve the issue:

sudo /var/opt/letsencrypt/letsencrypt-auto renew
1 Like

It’s work
thanks for this quick answer

1 Like

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