Python Pyinstaller与--onedir一起崩溃,但与--onefile一起工作
我正在尝试用Python3.7.1和最新的PyInstaller构建一个应用程序。GUI是用PySide2编程的。应用程序不会做任何太花哨的事情。PyInstaller可以用Python Pyinstaller与--onedir一起崩溃,但与--onefile一起工作,python,python-3.x,pyinstaller,Python,Python 3.x,Pyinstaller,我正在尝试用Python3.7.1和最新的PyInstaller构建一个应用程序。GUI是用PySide2编程的。应用程序不会做任何太花哨的事情。PyInstaller可以用--onefile很好地构建应用程序,但是启动速度很慢,所以我想创建一个--onedir应用程序。然而,它给了我下面的错误 61215 WARNING: lib not found: shiboken2.abi3.dll dependency of c:\users\XXXX\appdata\local\programs\p
--onefile
很好地构建应用程序,但是启动速度很慢,所以我想创建一个--onedir
应用程序。然而,它给了我下面的错误
61215 WARNING: lib not found: shiboken2.abi3.dll dependency of c:\users\XXXX\appdata\local\programs\python\python37\lib\site-packages\PySide2\QtGui.pyd
61532 WARNING: lib not found: shiboken2.abi3.dll dependency of c:\users\XXXX\appdata\local\programs\python\python37\lib\site-packages\PySide2\QtNetwork.pyd
61965 WARNING: lib not found: shiboken2.abi3.dll dependency of c:\users\XXXX\appdata\local\programs\python\python37\lib\site-packages\PySide2\QtCore.pyd
62366 WARNING: lib not found: shiboken2.abi3.dll dependency of c:\users\XXXX\appdata\local\programs\python\python37\lib\site-packages\PySide2\QtWidgets.pyd
62629 WARNING: lib not found: shiboken2.abi3.dll dependency of c:\users\XXXX\appdata\local\programs\python\python37\lib\site-packages\PySide2\QtUiTools.pyd
62952 WARNING: lib not found: shiboken2.abi3.dll dependency of c:\users\XXXX\appdata\local\programs\python\python37\lib\site-packages\PySide2\QtXml.pyd
72954 WARNING: lib not found: shiboken2.abi3.dll dependency of c:\users\XXXX\appdata\local\programs\python\python37\lib\site-packages\PySide2\pyside2.abi3.dll
73735 INFO: Looking for eggs
73735 INFO: Using Python library c:\users\XXXX\appdata\local\programs\python\python37\python37.dll
73743 INFO: Found binding redirects:
[]
Traceback (most recent call last):
File "c:\users\XXXX\appdata\local\programs\python\python37\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\users\XXXX\appdata\local\programs\python\python37\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\XXXX\AppData\Roaming\Python\Python37\Scripts\pyinstaller.exe\__main__.py", line 9, in <module>
File "C:\Users\XXXX\AppData\Roaming\Python\Python37\site-packages\PyInstaller\__main__.py", line 111, in run
run_build(pyi_config, spec_file, **vars(args))
File "C:\Users\XXXX\AppData\Roaming\Python\Python37\site-packages\PyInstaller\__main__.py", line 63, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "C:\Users\XXXX\AppData\Roaming\Python\Python37\site-packages\PyInstaller\building\build_main.py", line 844, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "C:\Users\XXXX\AppData\Roaming\Python\Python37\site-packages\PyInstaller\building\build_main.py", line 791, in build
exec(code, spec_namespace)
File "app.spec", line 16, in <module>
noarchive=True)
File "C:\Users\XXXX\AppData\Roaming\Python\Python37\site-packages\PyInstaller\building\build_main.py", line 243, in __init__
self.__postinit__()
File "C:\Users\XXXX\AppData\Roaming\Python\Python37\site-packages\PyInstaller\building\datastruct.py", line 158, in __postinit__
self.assemble()
File "C:\Users\XXXX\AppData\Roaming\Python\Python37\site-packages\PyInstaller\building\build_main.py", line 597, in assemble
for name, path, typecode in compile_py_files(new_toc, CONF['workpath']):
File "C:\Users\XXXX\AppData\Roaming\Python\Python37\site-packages\PyInstaller\utils\misc.py", line 150, in compile_py_files
with open(obj_fnm, 'rb') as fh:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\XXXX\\AppData\\Roaming\\Python\\Python37\\Scripts\\pyinstaller.exe\\__main__.pyo'
命令行:pyinstaller--noconfirm--clean app.spec app.py
我做错了什么
谢谢 尝试使用:
pyinstaller.exe
而不仅仅是:
pyinstaller
查找缺少的库libshiboken2.dll。(MacOS和Linux上的libshiboken2.dylib) pip安装shiboken2 然后在site packages/shiboken2中,您可以找到丢失的libshiboken2.dll,您可以将其复制到site packages/Pyside2,然后它就可以工作了 在MacOS和Linux上也是如此(在这些情况下,Libshibkoken2.dylib)
希望这对其他人有所帮助。您的build命令错误,请使用
spec
或将参数传递给app.py
pyinstaller应用程序.spec
或pyinstaller--noconfirm--cleanapp.py
pyinstaller