gpt4 book ai didi

python - Pyinstaller 3.4 无法在使用 Python 2.7 的 Windows 10 上运行

转载 作者:行者123 更新时间:2023-12-01 08:35:01 28 4
gpt4 key购买 nike

我最近重新安装了 Windows 10。我正在使用 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

有人知道这是怎么回事吗?在重新安装所有内容之前,它可以使用相同的文件正常工作。

最佳答案

我最终只是将 Pyinstaller 降级到 3.3,这对我的应用程序来说效果很好。

pip install pyinstaller==3.3

注意:3.0 也可以按照我的评论中所述工作。我成功地尝试了 3.3,现在正在使用它,因为它较新。

关于python - Pyinstaller 3.4 无法在使用 Python 2.7 的 Windows 10 上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53768797/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com