"no module named atexit" when I run a program deployed using pyinstaller

First of all, Fedora 13 is running on the computer, and the version of PyInstaller is 1.5.1

I used -onefile when creating the specification.

I had no error running 'import atexit' from the Python interpreter.

Here's the trace from running the binary:

Traceback (most recent call last): File "<string>", line 14, in <module> File "/home/pyinstaller-1.5.1/iu.py", line 436, in importHook mod = _self_doimport(nm, ctx, fqname) File "/home/pyinstaller-1.5.1/iu.py", line 495, in doimport mod = importfunc(nm) File "/home/pyinstaller-1.5.1/iu.py", line 297, in getmod mod = owner.getmod(nm) File "/home/pyinstaller-1.5.1/archive.py", line 468, in getmod return iu.DirOwner.getmod(self, self.prefix+'.'+nm) File "/home/pyinstaller-1.5.1/iu.py", line 109, in getmod mod = imp.load_module(nm, fp, attempt, (ext, mode, typ)) File "/home/pyinstaller-1.5.1/iu.py", line 436, in importHook mod = _self_doimport(nm, ctx, fqname) File "/home/pyinstaller-1.5.1/iu.py", line 505, in doimport mod = director.getmod(nm) File "/home/pyinstaller-1.5.1/iu.py", line 297, in getmod mod = owner.getmod(nm) File "/home/pyinstaller-1.5.1/iu.py", line 109, in getmod mod = imp.load_module(nm, fp, attempt, (ext, mode, typ)) File "/home/pyinstaller-1.5.1/iu.py", line 455, in importHook raise ImportError, "No module named %s" % fqname ImportError: No module named atexit 
+6
source share
1 answer

I solved this by adding "import atexit" to the source code. Hope this helps other people who have similar problems.

+6
source

Source: https://habr.com/ru/post/908755/


All Articles