问题描述
我正在致力于应用PyQt5和PyQtWebEngine。我在pyinstaller命令中遇到了PyQt5的问题。
Pyinstaller命令
pyinstaller --distpath "./src" --workpath "./src/packages/installer/build" --specpath "./src/packages/installer/resource" --name="packman" --onefile --console ./src/main.py
执行命令后,将调用FileNotFound异常。
C:\Me\Git\skp\corenode>pyinstaller --distpath "./src" --workpath "./src/packages/installer/build" --specpath "./src/packages/installer/resource" --name="packman" --onefile --console ./src/main.py
67 INFO: PyInstaller: 4.0
67 INFO: Python: 3.7.4
67 INFO: Platform: Windows-10-10.0.18362-SP0
68 INFO: wrote ./src/packages/installer/resource\packman.spec
71 INFO: UPX is not available.
73 INFO: Extending PYTHONPATH with paths
['C:\\Me\\Git\\skp\\corenode','C:\\Me\\Git\\skp\\corenode\\src\\packages\\installer\\resource']
83 INFO: checking Analysis
83 INFO: Building Analysis because Analysis-00.toc is non existent
84 INFO: Initializing module dependency graph...
87 INFO: Caching module graph hooks...
105 INFO: Analyzing base_library.zip ...
3336 INFO: Caching module dependency graph...
3452 INFO: running Analysis Analysis-00.toc
3455 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by c:\users\akrzysko\appdata\local\programs\python\python37\python.exe
3567 INFO: Analyzing src\main.py
4740 INFO: Processing module hooks...
4740 INFO: Loading module hook 'hook-encodings.py' from 'c:\\users\\akrzysko\\appdata\\local\\programs\\python\\python37\\lib\\site-packages\\PyInstaller\\hooks'...
4839 INFO: Loading module hook 'hook-PyQt5.py' from 'c:\\users\\akrzysko\\appdata\\local\\programs\\python\\python37\\lib\\site-packages\\PyInstaller\\hooks'...
5040 WARNING: Hidden import "sip" not found!
5040 WARNING: Hidden import "PyQt5.sip" not found!
5040 INFO: Loading module hook 'hook-PyQt5.QtCore.py' from 'c:\\users\\akrzysko\\appdata\\local\\programs\\python\\python37\\lib\\site-packages\\PyInstaller\\hooks'...
5165 INFO: Loading module hook 'hook-PyQt5.QtGui.py' from 'c:\\users\\akrzysko\\appdata\\local\\programs\\python\\python37\\lib\\site-packages\\PyInstaller\\hooks'...
5392 INFO: Loading module hook 'hook-PyQt5.QtWidgets.py' from 'c:\\users\\akrzysko\\appdata\\local\\programs\\python\\python37\\lib\\site-packages\\PyInstaller\\hooks'...
5794 INFO: Loading module hook 'hook-sqlite3.py' from 'c:\\users\\akrzysko\\appdata\\local\\programs\\python\\python37\\lib\\site-packages\\PyInstaller\\hooks'...
5898 INFO: Loading module hook 'hook-xml.py' from 'c:\\users\\akrzysko\\appdata\\local\\programs\\python\\python37\\lib\\site-packages\\PyInstaller\\hooks'...
5979 INFO: checking Tree
5980 INFO: Building Tree because Tree-00.toc is non existent
5980 INFO: Building Tree Tree-00.toc
5982 INFO: checking Tree
5982 INFO: Building Tree because Tree-01.toc is non existent
5982 INFO: Building Tree Tree-01.toc
Traceback (most recent call last):
File "c:\users\akrzysko\appdata\local\programs\python\python37\lib\runpy.py",line 193,in _run_module_as_main
"__main__",mod_spec)
File "c:\users\akrzysko\appdata\local\programs\python\python37\lib\runpy.py",line 85,in _run_code
exec(code,run_globals)
File "C:\Users\akrzysko\AppData\Local\Programs\Python\python37\Scripts\pyinstaller.exe\__main__.py",line 7,in <module>
File "c:\users\akrzysko\appdata\local\programs\python\python37\lib\site-packages\PyInstaller\__main__.py",line 114,in run
run_build(pyi_config,spec_file,**vars(args))
File "c:\users\akrzysko\appdata\local\programs\python\python37\lib\site-packages\PyInstaller\__main__.py",line 65,in run_build
PyInstaller.building.build_main.main(pyi_config,**kwargs)
File "c:\users\akrzysko\appdata\local\programs\python\python37\lib\site-packages\PyInstaller\building\build_main.py",line 720,in main
build(specfile,kw.get('distpath'),kw.get('workpath'),kw.get('clean_build'))
File "c:\users\akrzysko\appdata\local\programs\python\python37\lib\site-packages\PyInstaller\building\build_main.py",line 667,in build
exec(code,spec_namespace)
File "./src/packages/installer/resource\packman.spec",line 17,in <module>
noarchive=False)
File "c:\users\akrzysko\appdata\local\programs\python\python37\lib\site-packages\PyInstaller\building\build_main.py",line 242,in __init__
self.__postinit__()
File "c:\users\akrzysko\appdata\local\programs\python\python37\lib\site-packages\PyInstaller\building\datastruct.py",line 160,in __postinit__
self.assemble()
File "c:\users\akrzysko\appdata\local\programs\python\python37\lib\site-packages\PyInstaller\building\build_main.py",line 425,in assemble
self.datas.extend(deps_proc.make_datas_toc())
File "c:\users\akrzysko\appdata\local\programs\python\python37\lib\site-packages\PyInstaller\building\toc_conversion.py",line 111,in make_datas_toc
toplevel = dist.get_Metadata('top_level.txt').strip()
File "c:\users\akrzysko\appdata\local\programs\python\python37\lib\site-packages\pkg_resources\__init__.py",line 1421,in get_Metadata
value = self._get(path)
File "c:\users\akrzysko\appdata\local\programs\python\python37\lib\site-packages\pkg_resources\__init__.py",line 1617,in _get
with open(path,'rb') as stream:
FileNotFoundError: [Errno 2] No such file or directory: 'c:\\users\\akrzysko\\appdata\\local\\programs\\python\\python37\\lib\\site-packages\\pyqt5-5.15.1-py3.7-win-amd64.egg\\EGG-INFO\\top_level.txt'
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)