letsencrypt failed with ImportError: No module named interface

2024/9/16 23:10:31

I'm using Amazon linux, and I followed some steps for using letsencrypt that easily found in google search, but all it fails with:

Error: couldn't get currently installed version for /root/.local/share/letsencrypt/bin/letsencrypt: 
Traceback (most recent call last):File "/root/.local/share/letsencrypt/bin/letsencrypt", line 7, in <module>from certbot.main import mainFile "/root/.local/share/letsencrypt/local/lib/python2.7/dist-packages/certbot/main.py", line 11, in <module>import zope.componentFile "/root/.local/share/letsencrypt/local/lib/python2.7/dist-packages/zope/component/__init__.py", line 16, in <module>from zope.interface import Interface
ImportError: No module named interface

What I do is:

# git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
# /opt/letsencrypt/letsencrypt-auto --debug

That's it. So I tried to fix this, but dozens of solution that I found all won't worked to me.

Most of them said try this:

unset PYTHON_INSTALL_LAYOUT

But still got same error, nothing changes. And someone said that type this:

pip install --upgrade pip

But after typed that, I can't use pip anymore, it failed with some kind of command not found error, so I had recreated my server again.

I also tried to use CertBot, but it gives me exactly same error!

I'm using Linux 4.4.51-40.58.amzn1.x86_64 x86_64, need a help. I spent almost a day, but nothing progressed.

Every solution that I was found were not worked to me. Any advice will very appreciate it.

Answer

Removing certbot directory did the trick for me.

rm -rf /opt/eff.org/certbot/wget https://dl.eff.org/certbot-auto
chmod a+x certbot-auto
sudo ./certbot-auto certonly --standalone -d example.com --no-bootstrap
https://en.xdnf.cn/q/72612.html

Related Q&A

ModuleNotFoundError: No module named skimage.util.montage

Im trying to import montage2d module from scikit-image:from skimage.util.montage import montage2dBut this error popped up:ModuleNotFoundError: No module named skimage.util.montageIm pretty sure I insta…

upgrading python module within code

My question relates to this question: Installing python module within code, but involves upgrading the module.Ive triedpackages=[apscheduler,beautifulsoup4,gdata]def upgrade(packages):for package in pa…

Django - 403 Forbidden CSRF verification failed

I have a contact form in Django for my website and when I was testing it locally it was working fine but now when I try to submit my contact form "live" it always comes up with 403 Forbidden …

Python model object validation

Im writing an interface to be used by two applications. This interface should use some DoSomethingRequest and DoSomethingResponse classes to do the communication.Is there any library that does some mod…

Cassandra 1.2 inserting/updating a blob column type using Python and the cql library

IntroI have a blob column on a Cassandra 1.2 column family, the table is defined as follows:CREATE TABLE objects (id text,obj blob,PRIMARY KEY (id) );The problem:The problem is that when I…

Using python with subprocess Popen

I am struggling to use subprocesses with python. Here is my task:Start an api via the command line (this should be no different than running any argument on the command line) Verify my API has come …

ipdb, multiple threads and autoreloading programs causing ProgrammingError

I am using ipdb debugger to debug multithreaded web applications locally (Django, Plone). Often ipdb seems to get confused because of the autoreload which happens when I am on the debug prompt. The res…

How to turn off logging buffer to get logs in real time with python command line tool?

I have a command line tool which produces plenty of logs. I want these logs to be sent to stdout as soon as theyre made. Right now, the program finishes everything (which can take several minutes), and…

How to tell if process is responding in Python on Windows

I am writing a python script to keep a buggy program open and I need to figure out if the program is not respoding and close it on windows. I cant quite figure out how to do this.

How to load and use a pretained PyTorch InceptionV3 model to classify an image

I have the same problem as How can I load and use a PyTorch (.pth.tar) model which does not have an accepted answer or one I can figure out how to follow the advice given.Im new to PyTorch. I am trying…