简体   繁体   中英

ImportError: No module named configobj

I created .exe file using pyinstaller 3.3.1 and I got this message

Traceback (most recent call last):
File "install.py", line 14, in <module>
ImportError: No module named configobj
[8468] Failed to execute script install

I'm working with python 2.7 using conda environment. Lately I had updated pyinstaller to version 3.3.1 so this happened to me while I'm checking that the update is safe.

I have also created another .exe file from different script that uses also this import and its went well, so any help will be welcome.

I got this error from certbot on Ubuntu 20.04 (focal). On this version of Ubuntu, python 2 seems to be mostly deprecated and many things don't work when using it. Everything needs to be configured to use python3.

When I ran certbot, it was still using python 2.

File "/usr/local/lib/python2.7/dist-packages/certbot/main.py", line 9, in <module>
    import configobj
ImportError: No module named configobj

Python 2 pip is no longer available from apt on this version of Ubuntu, so I was not able to install the proper libraries for python 2 using pip.

The version of certbot in apt is supposed to be for python3. ( python3-certbot ). The executable for certbot gets installed at /usr/bin/certbot .

After further investigating, I found that I had an older python 2 version of certbot hanging around at /usr/local/bin/certbot . Once I removed that ( sudo rm /usr/local/bin/certbot ), the python3 version of certbot runs just fine and is able to find all its libraries.

您需要通过 pip apt install python-pip安装 configobj

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM