This is probably what's gone wrong.
If you tried to use pip install
from the git repository, without using a virtual environment, it would have polluted your system's Python packages and resulted in this version conflict.
For future reference, there are instructions for safely installing Certbot via pip.
Using the Certbot snap should cleanly avoid all of these issues, because it is fully isolated from whatever Python packages you have on the rest of your system. You might need to remove that /usr/local/bin/certbot
file though - it's a remnant of trying to use pip install
.