pyinstaller解决生成.exe.notanexecutable报错

接上文将Python文件转化为exe文件,若生成EXE文件报如下错误:

E:\Program\Python\test1>pyinstaller -F main.py -i 1.ico -w
82 INFO: PyInstaller: 5.7.0
82 INFO: Python: 3.10.1
95 INFO: Platform: Windows-10-10.0.22000-SP0
96 INFO: wrote E:\Program\Python\test1\main.spec
98 INFO: UPX is not available.
99 INFO: Extending PYTHONPATH with paths
['E:\\Program\\Python\\test1']
309 INFO: checking Analysis
396 INFO: checking PYZ
407 INFO: checking PKG
483 INFO: Bootloader D:\Soft\Python310\lib\site-packages\PyInstaller\bootloader\Windows-64bit-intel\runw.exe
483 INFO: checking EXE
490 INFO: Rebuilding EXE-00.toc because main.exe missing
490 INFO: Building EXE from EXE-00.toc
490 INFO: Copying bootloader EXE to E:\Program\Python\test1\dist\main.exe.notanexecutable
494 INFO: Copying icon to EXE
Traceback (most recent call last):
  File "D:\Soft\Python310\lib\site-packages\PyInstaller\building\icon.py", line 50, in normalize_icon_type
    from PIL import Image as PILImage
ModuleNotFoundError: No module named 'PIL'

During handling of the above exception, another exception occurred:

Traceback (most recent call l
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值