'win32ctypes.pywin32.pywintypes.error: (87,'UpdateResource','参数不正确')'使用 pyinstaller 分配图标时出错
将图标附加到它
pyinstaller.exe --onefile --windowed --icon="test.ico" test.py
我正在使用 pyinstaller 从 .py 文件类型创建可执行文件,并使用命令'.ico' 500 像素 x 500 像素 和 24 位深度,使用 Photoshop 创建并导出为 '.bmp',然后手动导出改为'.ico' 在分配给文件夹时工作正常,但在尝试将其分配给 pyinstaller 可执行文件 时,我不断收到错误:
raise error(exception.winerror, exception.function, exception.strerror)
win32ctypes.pywin32.pywintypes.error: (87, 'UpdateResource', 'The parameter is incorrect')
如何解决此问题?
I am using pyinstaller to create an executable from a .py file type and attaching an icon to it using the command
pyinstaller.exe --onefile --windowed --icon="test.ico" test.py
The '.ico' is 500px by 500px and 24bit depth and was created with Photoshop and exported as a '.bmp' and then manually changed to a '.ico' and worked fine when assigned to a folder but when trying to assign it to the pyinstaller executable I keep getting the error:
raise error(exception.winerror, exception.function, exception.strerror)
win32ctypes.pywin32.pywintypes.error: (87, 'UpdateResource', 'The parameter is incorrect')
How to fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过进一步调查,似乎图标文件未正确生成。
如果有人遇到此问题,请使用:icoconverter.com 正确转换您的图像
After further investigation it appears that the icon file was not generated correctly.
If anyone is having this issue use: icoconverter.com to convert your image properly