【问题标题】:PyInstaller fails to include iconPyInstaller 无法包含图标
【发布时间】:2016-08-16 08:38:57
【问题描述】:

我正在使用 PyInstaller (V3.1.1) 在 Windows 7 64 位上编译我的程序。这工作正常:

pyinstaller --onefile --version=version.txt program.py

这失败了:

pyinstaller --onefile --version=version.txt --icon=icon.ico program.py

错误和我运行时一样:

>>> import win32api
>>> src = "C:\\path\\to\\icon.ico"
>>> win32api.LoadLibraryEx(src, 0, 2)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
pywintypes.error: (193, 'LoadLibraryEx', '%1 is not a valid Win32 application.')

我已经确定我安装了 32 位 python (3.5.1):

>>> import platform
>>> platform.architecture()
('32bit', 'WindowsPE')

与此相关的所有其他已解决问题似乎都可以通过安装 32 位 python 来解决。所有模块都是使用 pip 安装的。

【问题讨论】:

    标签: python python-3.x 32-bit pyinstaller


    【解决方案1】:

    我发现我使用的 .ico 文件已损坏。使用另一个在线转换器(.png -> .ico,一个文件中的所有大小),exe 编译成功。

    【讨论】:

    • 感谢您的解决方案。你节省了很多时间!
    猜你喜欢
    • 1970-01-01
    • 2016-09-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-11-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多