RHEL 7 ImportError: cannot import name ‘constants’

I’m posting this not seeking help, but offering. I have been knocking my head for a couple hours and managed to solve this problem and thought someone else might like to know how.

I am running on RHEL 7 (with system python 2.7.5), with nginx. Certbot installed via yum from system repos.

Recently, everything I tried to do with certbot resulted in the subject error message. Even just --version.

Long story short… looking closely at what I had installed, there were three related packages: certbot, python2-certbot, and python2-certbot-nginx. I happened to notice that the last of these three had a much lower version number than the other two. I yum update-d that one, and reinstalled the other two for good luck, and voila, problem fixed.

Hope this helps someone.


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