Certbot may throw some errors like this if your default python in 3.10 or above.
ModuleNotFoundError: No module named '_cffi_backend'
AttributeError: module 'collections' has no attribute 'Mapping'
solutions is edit cerbot script and make python 3.8 as its running version. Pls do the following.
vim /usr/bin/certbot
change the first line
#!/usr/bin/python3 to #!/usr/bin/python3.8