1

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.

YoavShe
  • 151
  • 2
  • 3
  • 11
  • have you tried to run on the conda prompt `pip install configobj` – Andre Motta Aug 20 '18 at 15:00
  • Yes, its installed and worked well for different script. – YoavShe Aug 20 '18 at 15:02
  • do you have another python instalation? or only conda? And try pip list and python -V from the same environment you are running the exe ( same directory) Check if it is the same from conda. If nothing works try to generate the exe again or run it in admin mode – Andre Motta Aug 20 '18 at 15:06
  • I'm working only with conda but I created 2 conda environments each one for a different version of pyinstaller, so i could check the new one without remove the old one. The version is correct and adjust to the env that i want to run. – YoavShe Aug 20 '18 at 15:11
  • Ok so do the procedures above and see which conda environment is running the exe – Andre Motta Aug 20 '18 at 15:12
  • I did it, its seems that the conda environment is correct. – YoavShe Aug 20 '18 at 15:14

2 Answers2

4

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.

Stephen Ostermiller
  • 23,933
  • 14
  • 88
  • 109
0

You need to install configobj via pip apt install python-pip

defro
  • 56
  • 3