PyInstaller TypeError:迭代非序列

时间:2015-09-18 14:34:56

标签: python python-2.7 iteration exe typeerror

我正在使用Python 2.7上的.py文件制作一个exe文件。我正在使用PyInstaller。

我完成了this guide,基本上是pip install pyinstaller,然后是pyinstaller.exe --onefile --windowed myfile.py

它有一些错误,说没有找到pywintypes27.dll和其他依赖项,但它一直运行,直到它因TypeError: iteration over non-sequence错误而停止。看起来非常接近我使用py2exe的相同问题:

RuntimeError: maximum recursion depth exceeded while calling a Python object.`

这是追溯:

C:\MYPATH>pyinstaller.exe --onefile -
-windowed myfile.py
62 INFO: wrote C:\MYPATH
Tool.spec
78 INFO: Testing for ability to set icons, version resources...
141 INFO: ... resource update available
141 INFO: UPX is not available.
171 INFO: Processing hook hook-os
296 INFO: Processing hook hook-time
312 INFO: Processing hook hook-cPickle
390 INFO: Processing hook hook-_sre
546 INFO: Processing hook hook-cStringIO
654 INFO: Processing hook hook-encodings
671 INFO: Processing hook hook-codecs
1233 INFO: Processing hook hook-httplib
1248 INFO: Processing hook hook-email
1404 INFO: Processing hook hook-email.message
1669 WARNING: library python%s%s required via ctypes not found
1841 INFO: Extending PYTHONPATH with C:\MYPATH
1841 INFO: checking Analysis
1841 INFO: building Analysis because out00-Analysis.toc non existent
1841 INFO: running Analysis out00-Analysis.toc
1841 INFO: Adding Microsoft.VC90.CRT to dependent assemblies of final executable

10015 INFO: Searching for assembly x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.2
1022.8_none ...
10015 INFO: Found manifest C:\windows\WinSxS\Manifests\x86_microsoft.vc90.crt_1f
c8b3b9a1e18e3b_9.0.21022.8_none_bcb86ed6ac711f91.manifest
10031 INFO: Searching for file msvcr90.dll
10031 INFO: Found file C:\windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b
_9.0.21022.8_none_bcb86ed6ac711f91\msvcr90.dll
10031 INFO: Searching for file msvcp90.dll
10031 INFO: Found file C:\windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b
_9.0.21022.8_none_bcb86ed6ac711f91\msvcp90.dll
10031 INFO: Searching for file msvcm90.dll
10031 INFO: Found file C:\windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b
_9.0.21022.8_none_bcb86ed6ac711f91\msvcm90.dll
10281 INFO: Analyzing C:\Anaconda\lib\site-packages\PyInstaller\loader\_pyi_boot
strap.py
10327 INFO: Processing hook hook-os
10374 INFO: Processing hook hook-site
10404 INFO: Processing hook hook-encodings
10546 INFO: Processing hook hook-time
10561 INFO: Processing hook hook-cPickle
10654 INFO: Processing hook hook-_sre
10811 INFO: Processing hook hook-cStringIO
10920 INFO: Processing hook hook-codecs
11496 INFO: Processing hook hook-httplib
11496 INFO: Processing hook hook-email
11638 INFO: Processing hook hook-email.message
11919 WARNING: library python%s%s required via ctypes not found
12184 INFO: Processing hook hook-pydoc
12480 INFO: Analyzing C:\Anaconda\lib\site-packages\PyInstaller\loader\pyi_impor
ters.py
12605 INFO: Analyzing C:\Anaconda\lib\site-packages\PyInstaller\loader\pyi_archi
ve.py
12730 INFO: Analyzing C:\Anaconda\lib\site-packages\PyInstaller\loader\pyi_carch
ive.py
12838 INFO: Analyzing C:\Anaconda\lib\site-packages\PyInstaller\loader\pyi_os_pa
th.py
12855 INFO: Analyzing myfile.py
14555 INFO: Processing hook hook-pyodbc
15023 INFO: Processing hook hook-jinja2
15911 INFO: Processing hook hook-distutils
15975 INFO: Processing hook hook-sysconfig
15975 INFO: Processing hook hook-parser
16021 INFO: Processing hook hook-xml
16223 INFO: Processing hook hook-xml.sax
16411 INFO: Processing hook hook-pyexpat
24648 INFO: Processing hook hook-IPython
35427 INFO: Processing hook hook-matplotlib
39078 INFO: Processing hook hook-setuptools
39874 INFO: Processing hook hook-win32com
39936 INFO: Processing hook hook-win32com.client
39999 INFO: Processing hook hook-pythoncom
Traceback (most recent call last):
  File "<string>", line 11, in <module>
  File "C:\Anaconda\lib\site-packages\pythoncom.py", line 2, in <module>
    import pywintypes
  File "C:\Anaconda\lib\site-packages\win32\lib\pywintypes.py", line 124, in <mo
dule>
    __import_pywin32_system_module__("pywintypes", globals())
  File "C:\Anaconda\lib\site-packages\win32\lib\pywintypes.py", line 98, in __im
port_pywin32_system_module__
    raise ImportError("No system module '%s' (%s)" % (modname, filename))
ImportError: No system module 'pywintypes' (pywintypes27.dll)
40186 INFO: Processing hook hook-pywintypes
Traceback (most recent call last):
  File "<string>", line 11, in <module>
  File "C:\Anaconda\lib\site-packages\pythoncom.py", line 2, in <module>
    import pywintypes
  File "C:\Anaconda\lib\site-packages\win32\lib\pywintypes.py", line 124, in <mo
dule>
    __import_pywin32_system_module__("pywintypes", globals())
  File "C:\Anaconda\lib\site-packages\win32\lib\pywintypes.py", line 98, in __im
port_pywin32_system_module__
    raise ImportError("No system module '%s' (%s)" % (modname, filename))
ImportError: No system module 'pywintypes' (pywintypes27.dll)
40498 INFO: Processing hook hook-win32ui
43976 INFO: Processing hook hook-pytz
45209 INFO: Processing hook hook-scipy.sparse.csgraph
46176 INFO: Processing hook hook-PIL
46597 INFO: Processing hook hook-PIL.Image
52930 INFO: Processing hook hook-lxml.etree
53321 INFO: Processing hook hook-xml.etree.cElementTree
53351 INFO: Processing hook hook-_elementtree
108233 INFO: Processing hook hook-matplotlib.backends
108732 INFO: Processing hook hook-PyQt4
108748 INFO: Processing hook hook-PyQt4.QtGui
110557 INFO: Processing hook hook-PyQt4.QtCore
113865 INFO: Processing hook hook-xml.dom
114082 INFO: Processing hook hook-zmq
117171 INFO: Processing hook hook-_tkinter
117453 INFO: checking Tree
117453 INFO: building because out00-Tree.toc missing or bad
117453 INFO: building Tree out00-Tree.toc
118529 INFO: checking Tree
118529 INFO: building because out01-Tree.toc missing or bad
118529 INFO: building Tree out01-Tree.toc
119901 INFO: Processing hook hook-PyQt4.QtSvg
120370 INFO: Processing hook hook-sqlite3
122210 INFO: Processing hook hook-xml.dom.domreg
122865 INFO: Processing hook hook-tables
126298 INFO: Processing hook hook-pygments.lexers
126423 INFO: Processing hook hook-pygments.styles
133473 INFO: Processing hook hook-sqlalchemy
141867 INFO: Processing hook hook-scipy.io.matlab
143785 INFO: Processing hook hook-sphinx
149151 INFO: Processing hook hook-docutils
156749 INFO: Processing hook hook-h5py
172786 INFO: Hidden import 'codecs' has been found otherwise
172786 INFO: Hidden import 'encodings' has been found otherwise
172786 INFO: Looking for run-time hooks
172801 INFO: Analyzing rthook C:\Anaconda\lib\site-packages\PyInstaller\loader\r
thooks\pyi_rth_pkgres.py
173003 INFO: Analyzing rthook C:\Anaconda\lib\site-packages\PyInstaller\loader\r
thooks\pyi_rth_win32comgenpy.py
173144 INFO: Analyzing rthook C:\Anaconda\lib\site-packages\PyInstaller\loader\r
thooks\pyi_rth_mplconfig.py
173269 INFO: Analyzing rthook C:\Anaconda\lib\site-packages\PyInstaller\loader\r
thooks\pyi_rth_mpldata.py
173378 INFO: Analyzing rthook C:\Anaconda\lib\site-packages\PyInstaller\loader\r
thooks\pyi_rth_PIL_Image.py
173488 INFO: Analyzing rthook C:\Anaconda\lib\site-packages\PyInstaller\loader\r
thooks\pyi_rth_Tkinter.py
173628 INFO: Analyzing rthook C:\Anaconda\lib\site-packages\PyInstaller\loader\r
thooks\pyi_rth_qt4plugins.py
178605 WARNING: lib not found: QtGui4.dll dependency of C:/Anaconda/Lib/site-pac
kages/PyQt4/plugins\accessible\qtaccessiblewidgets4.dll
178651 WARNING: lib not found: QtCore4.dll dependency of C:/Anaconda/Lib/site-pa
ckages/PyQt4/plugins\accessible\qtaccessiblewidgets4.dll
178807 WARNING: lib not found: QtGui4.dll dependency of C:/Anaconda/Lib/site-pac
kages/PyQt4/plugins\iconengines\qsvgicon4.dll
178854 WARNING: lib not found: QtSvg4.dll dependency of C:/Anaconda/Lib/site-pac
kages/PyQt4/plugins\iconengines\qsvgicon4.dll
178917 WARNING: lib not found: QtCore4.dll dependency of C:/Anaconda/Lib/site-pa
ckages/PyQt4/plugins\iconengines\qsvgicon4.dll
179026 WARNING: lib not found: QtGui4.dll dependency of C:/Anaconda/Lib/site-pac
kages/PyQt4/plugins\imageformats\qgif4.dll
179088 WARNING: lib not found: QtCore4.dll dependency of C:/Anaconda/Lib/site-pa
ckages/PyQt4/plugins\imageformats\qgif4.dll
179197 WARNING: lib not found: QtGui4.dll dependency of C:/Anaconda/Lib/site-pac
kages/PyQt4/plugins\imageformats\qico4.dll
179243 WARNING: lib not found: QtCore4.dll dependency of C:/Anaconda/Lib/site-pa
ckages/PyQt4/plugins\imageformats\qico4.dll
179493 WARNING: lib not found: QtGui4.dll dependency of C:/Anaconda/Lib/site-pac
kages/PyQt4/plugins\imageformats\qjpeg4.dll
179541 WARNING: lib not found: QtCore4.dll dependency of C:/Anaconda/Lib/site-pa
ckages/PyQt4/plugins\imageformats\qjpeg4.dll
179728 WARNING: lib not found: QtGui4.dll dependency of C:/Anaconda/Lib/site-pac
kages/PyQt4/plugins\imageformats\qmng4.dll
179789 WARNING: lib not found: QtCore4.dll dependency of C:/Anaconda/Lib/site-pa
ckages/PyQt4/plugins\imageformats\qmng4.dll
179898 WARNING: lib not found: QtCore4.dll dependency of C:/Anaconda/Lib/site-pa
ckages/PyQt4/plugins\imageformats\qsvg4.dll
179946 WARNING: lib not found: QtGui4.dll dependency of C:/Anaconda/Lib/site-pac
kages/PyQt4/plugins\imageformats\qsvg4.dll
180009 WARNING: lib not found: QtXml4.dll dependency of C:/Anaconda/Lib/site-pac
kages/PyQt4/plugins\imageformats\qsvg4.dll
180055 WARNING: lib not found: QtSvg4.dll dependency of C:/Anaconda/Lib/site-pac
kages/PyQt4/plugins\imageformats\qsvg4.dll
180148 WARNING: lib not found: QtGui4.dll dependency of C:/Anaconda/Lib/site-pac
kages/PyQt4/plugins\imageformats\qtga4.dll
180210 WARNING: lib not found: QtCore4.dll dependency of C:/Anaconda/Lib/site-pa
ckages/PyQt4/plugins\imageformats\qtga4.dll
180367 WARNING: lib not found: QtGui4.dll dependency of C:/Anaconda/Lib/site-pac
kages/PyQt4/plugins\imageformats\qtiff4.dll
180414 WARNING: lib not found: QtCore4.dll dependency of C:/Anaconda/Lib/site-pa
ckages/PyQt4/plugins\imageformats\qtiff4.dll
180508 WARNING: lib not found: QtGui4.dll dependency of C:/Anaconda/Lib/site-pac
kages/PyQt4/plugins\graphicssystems\qglgraphicssystem4.dll
180569 WARNING: lib not found: QtOpenGL4.dll dependency of C:/Anaconda/Lib/site-
packages/PyQt4/plugins\graphicssystems\qglgraphicssystem4.dll
180617 WARNING: lib not found: QtCore4.dll dependency of C:/Anaconda/Lib/site-pa
ckages/PyQt4/plugins\graphicssystems\qglgraphicssystem4.dll
180881 WARNING: lib not found: libzmq.pyd dependency of C:\Anaconda\lib\site-pac
kages\zmq\devices\monitoredqueue.pyd
182676 WARNING: lib not found: QtCore4.dll dependency of C:/Anaconda/Lib/site-pa
ckages/PyQt4/plugins\codecs\qcncodecs4.dll
182832 WARNING: lib not found: QtCore4.dll dependency of C:/Anaconda/Lib/site-pa
ckages/PyQt4/plugins\codecs\qjpcodecs4.dll
182940 WARNING: lib not found: QtCore4.dll dependency of C:/Anaconda/Lib/site-pa
ckages/PyQt4/plugins\codecs\qkrcodecs4.dll
183097 WARNING: lib not found: QtCore4.dll dependency of C:/Anaconda/Lib/site-pa
ckages/PyQt4/plugins\codecs\qtwcodecs4.dll
190506 INFO: Adding Microsoft.VC90.MFC to dependent assemblies of final executab
le
191927 INFO: Searching for assembly x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.
21022.8_none ...
191943 INFO: Found manifest C:\windows\WinSxS\Manifests\x86_microsoft.vc90.mfc_1
fc8b3b9a1e18e3b_9.0.21022.8_none_b81d038aaf540e86.manifest
191957 INFO: Searching for file mfc90.dll
191973 INFO: Found file C:\windows\WinSxS\x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3
b_9.0.21022.8_none_b81d038aaf540e86\mfc90.dll
191989 INFO: Searching for file mfc90u.dll
191989 INFO: Found file C:\windows\WinSxS\x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3
b_9.0.21022.8_none_b81d038aaf540e86\mfc90u.dll
191989 INFO: Searching for file mfcm90.dll
191989 INFO: Found file C:\windows\WinSxS\x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3
b_9.0.21022.8_none_b81d038aaf540e86\mfcm90.dll
191989 INFO: Searching for file mfcm90u.dll
191989 INFO: Found file C:\windows\WinSxS\x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3
b_9.0.21022.8_none_b81d038aaf540e86\mfcm90u.dll
208042 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of
 final executable
208572 INFO: Using Python library C:\Anaconda\python27.dll
Traceback (most recent call last):
  File "C:\Anaconda\Scripts\pyinstaller-script.py", line 9, in <module>
    load_entry_point('PyInstaller==2.1', 'console_scripts', 'pyinstaller')()
  File "C:\Anaconda\lib\site-packages\PyInstaller\main.py", line 88, in run
    run_build(opts, spec_file, pyi_config)
  File "C:\Anaconda\lib\site-packages\PyInstaller\main.py", line 46, in run_buil
d
    PyInstaller.build.main(pyi_config, spec_file, **opts.__dict__)
  File "C:\Anaconda\lib\site-packages\PyInstaller\build.py", line 1924, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'
))
  File "C:\Anaconda\lib\site-packages\PyInstaller\build.py", line 1873, in build

    execfile(spec)
  File "C:\MYPATH\myfile.sp
ec", line 6, in <module>
    runtime_hooks=None)
  File "C:\Anaconda\lib\site-packages\PyInstaller\build.py", line 446, in __init
__
    self.__postinit__()
  File "C:\Anaconda\lib\site-packages\PyInstaller\build.py", line 309, in __post
init__
    self.assemble()
  File "C:\Anaconda\lib\site-packages\PyInstaller\build.py", line 700, in assemb
le
    for ln in importTracker.getwarnings():
  File "C:\Anaconda\lib\site-packages\PyInstaller\depend\imptracker.py", line 38
1, in getwarnings
    for w in mod.warnings:
TypeError: iteration over non-sequence

为什么我会收到此错误以及如何解决?

1 个答案:

答案 0 :(得分:0)

我遇到了QtCore4模块的问题。尝试在this answer中安装最新版本的pyinstaller(开发版)。有了它,它对我有用。