接上文将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