No module named certbot

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. https://crt.sh/?q=example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is: floristpony.eu.org

I ran this command: /opt/certbot/bin/certbot certificates

It produced this output:

Traceback (most recent call last):
  File "/opt/certbot/bin/certbot", line 5, in <module>
    from certbot.main import main
ModuleNotFoundError: No module named 'certbot'

My web server is (include version): nginx 1.22.1

The operating system my web server runs on is (include version): Debian 12 (bookworm)

My hosting provider, if applicable, is: Google Cloud (using free credits, at the moment)

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

I'm using a control panel to manage my site (no, or provide the name and version of the control panel): no

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot): probably latest, I forgot to check

So yeah, maybe because of python upgrade, I no longer able to execute certbot commands. And yes it's on virtual environment (after dealing with apt broken packages error while turns out I need to manually install the latest version of python3-venv package)
How do I fix this issue? Thank you.

If you're using our pip instructions, you will need to destroy and recreate the virtual environment from scratch after upgrading to a new Debian major version.

Your data isn't stored in /opt/certbot, so it's safe to delete it and follow the instructions from the beginning.

7 Likes

Yup, it worked. Thank you very much :blush:

2 Likes

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