Certbot (PIP) stopped working after upgrading python to 3.11

Hi,

I installed certbot via PIP in my CentOS 8 Stream vps. Python version was 3.9

Now, I upgraded Python to 3.11. Since then, certbot is not working. showing error.

How to fix it?

Thanks

1 Like

Did you install certbot to a venv? Did you update the venv to the new Python version?

4 Likes

@linkp
Thanks for your reply. I just updated Python3 and nothing else. Then certbot was not working. Then I followed the steps at Certbot Instructions | Certbot now it is working.

I have a question. Is it okay, that I have both PIP and Snap. Then I can choose between /opt/certbot/bin/pip or /snap/bin/certbot

If one is not working (maybe in future for any reason), I can switch between them.

Any issues with this? or okay?

Thanks

1 Like

@linkp
I don't know much about Python. How can I update the venv to new Python?

I just ran this command.

sudo python3 -m venv /opt/certbot/

No. You won't want to use PIP and Snap. Pick one.

If you didn't create a venv for your PIP installation, that can certainly make things more difficult than they need to be.

If you aren't prepared to maintain a venv for PIP certbot, the Snap option is probably more suitable.

4 Likes

Did you clean up any remnants from your previous PIP installation?

4 Likes

Hi,

I know I dont want both of them.

But my question is, is it okay to have them both? So that I can switch between. Any technical problem with that?

I dont know how to do that. I dont have information about PIP. Can you share me the command? Either way, cerbot (PIP) is working now. Do I need to " clean up any remnants " ?

Thanks

1 Like

I ran these commands from the website.

  1. sudo python3 -m venv /opt/certbot/

  2. sudo /opt/certbot/bin/pip install --upgrade pip

  3. sudo /opt/certbot/bin/pip install certbot certbot-nginx

Is that enough? Anything else to do?

I changed the values for 'python' and 'python3' to 3.11

Thanks

1 Like

I wouldn't, but no one can stop you if you are determined.

Without knowing where your previous PIP install was, I can't know if you cleaned it all up. You will have to work that out on your own.

You might want to test your new installation with some safe commands like certbot certificates.

You can see which certbot is being called with this:

ls -l `which certbot`
4 Likes

I haven't installed snap yet.

When I had Python 3.9, I ran these commands from the website.

  1. sudo python3 -m venv /opt/certbot/
  2. sudo /opt/certbot/bin/pip install --upgrade pip
  3. sudo /opt/certbot/bin/pip install certbot certbot-nginx

Then I upgraded to Python 3.11. Then ran the same commands.

This commands return the following.
/usr/bin/certbot -> /opt/certbot/bin/certbot

I told you I ran the commands from that website. How can I be sure that everything is running properly? And is not broken?

I ran this command, and it is showing my letsencrypt powered websites. (no issues).

I also ran 'dry-run' command. It is also working properly.

Anything else to check?

Thanks

1 Like

Btw, this command,

/opt/certbot/bin/pip --version returns the following.

pip 23.3.1 from /opt/certbot/lib64/python3.11/site-packages/pip (python 3.11)

1 Like

Nope. It is all looking good! :+1:

5 Likes

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