首先,机器正在运行Fedora 13,而PyInstaller的版本是1.5.1
生成规范时我确实使用了--onefile。
我在Python解释器中运行'import atexit'没有任何错误。
这是运行二进制文件的追溯:
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
答案 0 :(得分:6)
我通过在源代码中添加'import atexit'来解决这个问题。希望这能帮助其他有类似问题的人