Problem when adding a certificate on nginx

I use nginx, and when I try to add a certificate this error comes out. Does anyone know what the problem is?

Error: Command failed: certbot certonly --config "/etc/letsencrypt.ini" --cert-name "npm-8" --agree-tos --authenticator webroot --email "" --preferred-challenges "dns,http" --domains "" 
Traceback (most recent call last):
  File "/usr/local/bin/certbot", line 5, in 
    from certbot.main import main
  File "/usr/local/lib/python3.7/dist-packages/certbot/", line 6, in 
    from certbot._internal import main as internal_main
  File "/usr/local/lib/python3.7/dist-packages/certbot/_internal/", line 28, in 
    from certbot import crypto_util
  File "/usr/local/lib/python3.7/dist-packages/certbot/", line 42, in 
    from certbot import interfaces
  File "/usr/local/lib/python3.7/dist-packages/certbot/", line 21, in 
    from acme.client import ClientBase
ImportError: cannot import name 'ClientBase' from 'acme.client' (/usr/local/lib/python3.7/dist-packages/acme/

    at ChildProcess.exithandler (node:child_process:402:12)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1100:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)

Yes, the issue is that Certbot was installed using global pip on this server. Installing Python packages globally like this is very brittle and we strongly recommend that you don't do it.

Alternative installation methods are:

More precisely, the versions of these Python modules need to be in sync:

  • acme
  • certbot
  • certbot-nginx

That said, I also think you may need to deal with the DNS issue: can't find Non-existent domain

Maybe not to obtain the cert - you could use DNS-01 authentication for that.
But, when you go to use the cert, without a DNS entry it may be a bit difficult.


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