aaron.yang 发表于 2020-6-28 18:55:58

PyInstaller问题

为什么我用pyinstaller时,会报错?(全部下载过程如下)
912 INFO: PyInstaller: 3.6
912 INFO: Python: 3.8.3
913 INFO: Platform: Windows-10-10.0.18362-SP0
928 INFO: wrote D:\Aaron\编程\code\python\小甲鱼\飞机大战\plane.spec
936 INFO: UPX is not available.
938 INFO: Extending PYTHONPATH with paths
['D:\\Aaron\\编程\\code\\python\\小甲鱼\\飞机大战',
'D:\\Aaron\\编程\\code\\python\\小甲鱼\\飞机大战']
938 INFO: checking Analysis
939 INFO: Building Analysis because Analysis-00.toc is non existent
939 INFO: Initializing module dependency graph...
942 INFO: Caching module graph hooks...
1062 INFO: Analyzing base_library.zip ...
4745 INFO: Processing pre-find module path hook   distutils
4759 INFO: distutils: retargeting to non-venv dir 'c:\\users\\aaron\\appdata\\local\\programs\\python\\python38-32\\lib'
9796 INFO: Caching module dependency graph...
10009 INFO: running Analysis Analysis-00.toc
10055 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by c:\users\aaron\appdata\local\programs\python\python38-32\python.exe
10786 INFO: Analyzing D:\Aaron\编程\code\python\小甲鱼\飞机大战\plane.py
12520 INFO: Processing pre-find module path hook   site
12528 INFO: site: retargeting to fake-dir 'c:\\users\\aaron\\appdata\\local\\programs\\python\\python38-32\\lib\\site-packages\\PyInstaller\\fake-modules'
14276 INFO: Processing pre-safe import module hook   setuptools.extern.six.moves
18947 INFO: Processing module hooks...
18947 INFO: Loading module hook "hook-distutils.py"...
18999 INFO: Loading module hook "hook-encodings.py"...
19106 INFO: Loading module hook "hook-lib2to3.py"...
19169 INFO: Loading module hook "hook-numpy.core.py"...
20129 INFO: Loading module hook "hook-numpy.py"...
20131 INFO: Loading module hook "hook-pkg_resources.py"...
20772 INFO: Processing pre-safe import module hook   win32com
Traceback (most recent call last):
File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'win32com'
20869 INFO: Processing pre-safe import module hook   win32com
Traceback (most recent call last):
File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'win32com'
20958 INFO: Excluding import '__main__'
20959 INFO:   Removing import of __main__ from module pkg_resources
20959 INFO: Loading module hook "hook-pydoc.py"...
20967 INFO: Loading module hook "hook-pygame.py"...
20969 WARNING: Hidden import "pygame._view" not found!
20970 INFO: Loading module hook "hook-setuptools.py"...
21631 INFO: Loading module hook "hook-sysconfig.py"...
21647 INFO: Loading module hook "hook-xml.dom.domreg.py"...
21648 INFO: Loading module hook "hook-xml.etree.cElementTree.py"...
21649 INFO: Loading module hook "hook-xml.py"...
21650 INFO: Loading module hook "hook-_tkinter.py"...
22004 INFO: checking Tree
22004 INFO: Building Tree because Tree-00.toc is non existent
22005 INFO: Building Tree Tree-00.toc
22316 INFO: checking Tree
22317 INFO: Building Tree because Tree-01.toc is non existent
22317 INFO: Building Tree Tree-01.toc
22411 INFO: Looking for ctypes DLLs
22483 INFO: Analyzing run-time hooks ...
22489 INFO: Including run-time hook 'pyi_rth__tkinter.py'
22546 INFO: Including run-time hook 'pyi_rth_multiprocessing.py'
22558 INFO: Including run-time hook 'pyi_rth_pkgres.py'
22572 INFO: Looking for dynamic libraries
23942 INFO: Looking for eggs
23942 INFO: Using Python library c:\users\aaron\appdata\local\programs\python\python38-32\python38.dll
23942 INFO: Found binding redirects:
[]
23973 INFO: Warnings written to D:\Aaron\编程\code\python\小甲鱼\飞机大战\build\plane\warn-plane.txt
24097 INFO: Graph cross-reference written to D:\Aaron\编程\code\python\小甲鱼\飞机大战\build\plane\xref-plane.html
24197 INFO: checking PYZ
24197 INFO: Building PYZ because PYZ-00.toc is non existent
24197 INFO: Building PYZ (ZlibArchive) D:\Aaron\编程\code\python\小甲鱼\飞机大战\build\plane\PYZ-00.pyz
25572 INFO: Building PYZ (ZlibArchive) D:\Aaron\编程\code\python\小甲鱼\飞机大战\build\plane\PYZ-00.pyz completed successfully.
25599 INFO: checking PKG
25600 INFO: Building PKG because PKG-00.toc is non existent
25600 INFO: Building PKG (CArchive) PKG-00.pkg
40165 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
40242 INFO: Bootloader c:\users\aaron\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\bootloader\Windows-32bit\run.exe
40242 INFO: checking EXE
40242 INFO: Building EXE because EXE-00.toc is non existent
40242 INFO: Building EXE from EXE-00.toc
40338 INFO: Copying icons from ['bomb.ico']
Traceback (most recent call last):
File "c:\users\aaron\appdata\local\programs\python\python38-32\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
File "c:\users\aaron\appdata\local\programs\python\python38-32\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
File "C:\Users\Aaron\AppData\Local\Programs\Python\Python38-32\Scripts\pyinstaller.exe\__main__.py", line 9, in <module>
File "c:\users\aaron\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\__main__.py", line 114, in run
    run_build(pyi_config, spec_file, **vars(args))
File "c:\users\aaron\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\__main__.py", line 65, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "c:\users\aaron\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\building\build_main.py", line 734, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "c:\users\aaron\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\building\build_main.py", line 681, in build
    exec(code, spec_namespace)
File "D:\Aaron\编程\code\python\小甲鱼\飞机大战\plane.spec", line 20, in <module>
    exe = EXE(pyz,
File "c:\users\aaron\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\building\api.py", line 445, in __init__
    self.__postinit__()
File "c:\users\aaron\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\building\datastruct.py", line 160, in __postinit__
    self.assemble()
File "c:\users\aaron\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\building\api.py", line 539, in assemble
    icon.CopyIcons(tmpnm, self.icon)
File "c:\users\aaron\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\utils\win32\icon.py", line 216, in CopyIcons
    return CopyIcons_FromIco(dstpath, )
File "c:\users\aaron\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\utils\win32\icon.py", line 153, in CopyIcons_FromIco
    for i, f in enumerate(icons):
File "c:\users\aaron\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\utils\win32\icon.py", line 117, in __init__
    entry.fromfile(file)
File "c:\users\aaron\appdata\local\programs\python\python38-32\lib\site-packages\PyInstaller\utils\win32\icon.py", line 76, in fromfile
    self._fields_ = list(struct.unpack(self._format_, data))

谁能解决一下{:10_277:}

Twilight6 发表于 2020-6-28 19:02:13


ModuleNotFoundError: No module named 'win32com'

这个报错 可以通过这个解决下:
python -m pip install pypiwin32

其他的不知道了。。。我前几天写的程序 就是因为无论如何怎么打包都不成功...导致我放弃发论坛了

唉......难受

aaron.yang 发表于 2020-6-28 19:10:58

Twilight6 发表于 2020-6-28 19:02
这个报错 可以通过这个解决下:




没用{:10_277:}

Twilight6 发表于 2020-6-28 19:12:35

aaron.yang 发表于 2020-6-28 19:10
没用

肯定没有用呀你打包 Error 那么多,这个只安装一个模块

aaron.yang 发表于 2020-6-28 19:14:37

Twilight6 发表于 2020-6-28 19:12
肯定没有用呀你打包 Error 那么多,这个只安装一个模块

那怎么知道每个报错的地方都有安装什么库?

Twilight6 发表于 2020-6-28 19:21:07

aaron.yang 发表于 2020-6-28 19:14
那怎么知道每个报错的地方都有安装什么库?

我也不知....没办法了,我自己的打包也没搞懂是啥子情况哈哈    你看看百度能不能百度到吧...

hrp 发表于 2020-6-28 20:21:41

卸载 pyinstaller ,重装开发版本:
pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz
不过 github 网络速度是个问题,也不一定能解决。
页: [1]
查看完整版本: PyInstaller问题