Pyinstaller 3.4 不适用于使用 Python 2.7 的 Windows 10 [英] Pyinstaller 3.4 Not Working on Windows 10 with Python 2.7

查看:35
本文介绍了Pyinstaller 3.4 不适用于使用 Python 2.7 的 Windows 10的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近重新安装了 Windows 10.我正在使用 Python 2.7 并尝试使用 Pyinstaller 3.4 制作一个小的可执行文件.我收到以下错误:

I have recently reinstalled Windows 10. I am using Python 2.7 and trying to make a small executable using Pyinstaller 3.4. and I get the following error:

    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

有人知道这是怎么回事吗?在重新安装所有内容之前,它对同一个文件运行良好.

Does anyone know what is going on? It worked fine with the same file before reinstalling everything.

推荐答案

我最终只是将 Pyinstaller 降级到 3.3,这对我的应用程序运行良好.

I ended up just downgrading Pyinstaller to 3.3 and that worked fine for my application.

pip install pyinstaller==3.3

注意:3.0 也如我的评论中所述.我成功尝试了 3.3,现在正在使用它,因为它更新了.

Note: 3.0 also works as stated in my comment. I successfully tried 3.3 and am now using it because its newer.

这篇关于Pyinstaller 3.4 不适用于使用 Python 2.7 的 Windows 10的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆