我最近重新安装了Windows10。我正在使用Python 2.7,并尝试使用Pyinstaller 3.4创建一个小的可执行文件。我收到以下错误:
C:\python_programs\py_live>pyinstaller g_uplink.py
Traceback (most recent call last):
File "C:\Python27\Lib\runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "C:\Python27\Lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Python27\Scripts\pyinstaller.exe\__main__.py", line 5, in <module>
File "C:\Python27\Lib\site-packages\PyInstaller\__init__.py", line 16, in <module>
from . import compat
File "C:\Python27\Lib\site-packages\PyInstaller\compat.py", line 212, in <module>
from win32ctypes.pywin32 import pywintypes # noqa: F401
File "C:\Python27\Lib\site-packages\win32ctypes\pywin32\__init__.py", line 11, in <module>
from win32ctypes.pywin32 import win32api
File "C:\Python27\Lib\site-packages\win32ctypes\pywin32\win32api.py", line 12, in <module>
from win32ctypes.core import (
File "C:\Python27\Lib\site-packages\win32ctypes\core\__init__.py", line 36, in load_module
module = importlib.import_module(self.redirect_module)
File "C:\Python27\Lib\importlib\__init__.py", line 37, in import_module
__import__(name)
File "C:\Python27\Lib\site-packages\win32ctypes\core\cffi\_dll.py", line 19, in <module>
""")
File "C:\Python27\Lib\site-packages\cffi\api.py", line 107, in cdef
self._parser.parse(csource, override=override, packed=packed)
File "C:\Python27\Lib\site-packages\cffi\cparser.py", line 167, in parse
self._internal_parse(csource)
File "C:\Python27\Lib\site-packages\cffi\cparser.py", line 173, in _internal_parse
ast, macros, csource = self._parse(csource)
File "C:\Python27\Lib\site-packages\cffi\cparser.py", line 130, in _parse
self.convert_pycparser_error(e, csource)
File "C:\Python27\Lib\site-packages\cffi\cparser.py", line 159, in convert_pycparser_error
raise api.CDefError(msg)
cffi.api.CDefError: cannot parse "HMODULE WINAPI LoadLibraryExW(LPCTSTR lpFileName, HANDLE hFile, DWORD dwFlags);"
:16:16: before: LoadLibraryExW
有人知道发生了什么吗?在重新安装所有文件之前,它可以在同一个文件上正常工作。
答案 0 :(得分:0)
根据Mike自己的输入,安装PyInstaller 3.0将解决此问题。刚刚在Win7 Enterprise上试用过,效果很好。
答案 1 :(得分:0)
我最终只是将Pyinstaller降级到3.3,对于我的应用程序来说效果很好。
PivotItem
注意:3.0也可以按照我的评论所述工作。我成功尝试了3.3,现在正在使用它,因为它较新。