ubuntu pyinstaller 打包py后,运行出错,求助!

报错 报错 报错 报错

➜  dist pyinstaller -v
4.5.1

➜  dist whereis pyinstaller
pyinstaller: /home/maya/.local/bin/pyinstaller

➜  dist whereis python     
python: /usr/bin/python3.8 /usr/bin/python2.7-config /usr/bin/python3.8-config /usr/bin/python /usr/bin/python3.9-config /usr/bin/python2.7 /usr/bin/python3.9 /usr/lib/python3.8 /usr/lib/python2.7 /usr/lib/python3.9 /etc/python3.8 /etc/python2.7 /etc/python3.9 /usr/local/bin/python3.9-config /usr/local/bin/python3.9 /usr/local/lib/python3.8 /usr/local/lib/python2.7 /usr/local/lib/python3.9 /usr/include/python3.8 /usr/include/python2.7 /usr/include/python3.9 /usr/local/python3.9 /usr/share/python

➜  VIP_MOVIE pyinstaller -F -w -i f1.ico hello.py -p /usr/local/lib/python3.9/site-packages

94 INFO: PyInstaller: 4.5.1
94 INFO: Python: 3.9.5
98 INFO: Platform: Linux-5.11.0-36-generic-x86_64-with-glibc2.31
100 INFO: wrote /home/maya/Documents/pythonProject/1xiangmo/VIP_MOVIE/hello.spec
110 INFO: UPX is not available.
113 INFO: Extending PYTHONPATH with paths
['/home/maya/Documents/pythonProject/1xiangmo/VIP_MOVIE',
 '/usr/local/lib/python3.9/site-packages',
 '/home/maya/Documents/pythonProject/1xiangmo/VIP_MOVIE']
526 INFO: checking Analysis
537 INFO: Building because pathex changed
537 INFO: Initializing module dependency graph...
540 INFO: Caching module graph hooks...
552 INFO: Analyzing base_library.zip ...
6438 INFO: Processing pre-find module path hook distutils from '/home/maya/.local/lib/python3.9/site-packages/PyInstaller/hooks/pre_find_module_path/hook-distutils.py'.
6439 INFO: distutils: retargeting to non-venv dir '/usr/lib/python3.9'
12055 INFO: Caching module dependency graph...
12435 INFO: running Analysis Analysis-00.toc
12510 INFO: Analyzing /home/maya/Documents/pythonProject/1xiangmo/VIP_MOVIE/hello.py
12513 INFO: Processing module hooks...
12514 INFO: Loading module hook 'hook-_tkinter.py' from '/home/maya/.local/lib/python3.9/site-packages/PyInstaller/hooks'...
12670 INFO: checking Tree
12682 INFO: checking Tree
12773 WARNING: Tcl modules directory /usr/share/tcltk/tcl8.6/../tcl8 does not exist.
12775 INFO: Loading module hook 'hook-heapq.py' from '/home/maya/.local/lib/python3.9/site-packages/PyInstaller/hooks'...
12779 INFO: Loading module hook 'hook-sysconfig.py' from '/home/maya/.local/lib/python3.9/site-packages/PyInstaller/hooks'...
12796 INFO: Loading module hook 'hook-multiprocessing.util.py' from '/home/maya/.local/lib/python3.9/site-packages/PyInstaller/hooks'...
12799 INFO: Loading module hook 'hook-pickle.py' from '/home/maya/.local/lib/python3.9/site-packages/PyInstaller/hooks'...
12801 INFO: Loading module hook 'hook-distutils.py' from '/home/maya/.local/lib/python3.9/site-packages/PyInstaller/hooks'...
12802 INFO: Loading module hook 'hook-distutils.util.py' from '/home/maya/.local/lib/python3.9/site-packages/PyInstaller/hooks'...
12804 INFO: Loading module hook 'hook-lib2to3.py' from '/home/maya/.local/lib/python3.9/site-packages/PyInstaller/hooks'...
12828 INFO: Loading module hook 'hook-encodings.py' from '/home/maya/.local/lib/python3.9/site-packages/PyInstaller/hooks'...
12936 INFO: Loading module hook 'hook-xml.etree.cElementTree.py' from '/home/maya/.local/lib/python3.9/site-packages/PyInstaller/hooks'...
12937 INFO: Loading module hook 'hook-difflib.py' from '/home/maya/.local/lib/python3.9/site-packages/PyInstaller/hooks'...
12940 INFO: Loading module hook 'hook-xml.py' from '/home/maya/.local/lib/python3.9/site-packages/PyInstaller/hooks'...
13094 INFO: Looking for ctypes DLLs
13171 INFO: Analyzing run-time hooks ...
13179 INFO: Including run-time hook '/home/maya/.local/lib/python3.9/site-packages/PyInstaller/hooks/rthooks/pyi_rth_pkgutil.py'
13183 INFO: Including run-time hook '/home/maya/.local/lib/python3.9/site-packages/PyInstaller/hooks/rthooks/pyi_rth_multiprocessing.py'
13189 INFO: Including run-time hook '/home/maya/.local/lib/python3.9/site-packages/PyInstaller/hooks/rthooks/pyi_rth_inspect.py'
13203 INFO: Looking for dynamic libraries
13743 INFO: Looking for eggs
13743 INFO: Python library not in binary dependencies. Doing additional searching...
13833 INFO: Using Python library /usr/local/lib/libpython3.9.so.1.0
13844 INFO: Warnings written to /home/maya/Documents/pythonProject/1xiangmo/VIP_MOVIE/build/hello/warn-hello.txt
13904 INFO: Graph cross-reference written to /home/maya/Documents/pythonProject/1xiangmo/VIP_MOVIE/build/hello/xref-hello.html
13916 INFO: checking PYZ
13920 INFO: Building because toc changed
13921 INFO: Building PYZ (ZlibArchive) /home/maya/Documents/pythonProject/1xiangmo/VIP_MOVIE/build/hello/PYZ-00.pyz
14728 INFO: Building PYZ (ZlibArchive) /home/maya/Documents/pythonProject/1xiangmo/VIP_MOVIE/build/hello/PYZ-00.pyz completed successfully.
14736 INFO: checking PKG
14737 INFO: Building because toc changed
14737 INFO: Building PKG (CArchive) PKG-00.pkg
26700 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
26706 INFO: Bootloader /home/maya/.local/lib/python3.9/site-packages/PyInstaller/bootloader/Linux-64bit-intel/run
26706 INFO: checking EXE
26708 INFO: Rebuilding EXE-00.toc because hello missing
26708 INFO: Building EXE from EXE-00.toc
26709 INFO: Appending archive to ELF section in EXE /home/maya/Documents/pythonProject/1xiangmo/VIP_MOVIE/dist/hello
26806 INFO: Building EXE from EXE-00.toc completed successfully.

➜  VIP_MOVIE ls

'字符串转 md5 工具.py'   f1.ico   f4.ico     hello.spec     vip_movie.spec
 build                   f2.ico   fa.ico     __pycache__
 dist                    f3.ico   hello.py   vip_movie.py
➜  VIP_MOVIE cd dist                    
➜  dist ls
hello  vip_movie

报错,原因是什么?怎么解决,求助!!!

➜  dist ./hello       
             
[104655] Module object for struct is NULL!
Traceback (most recent call last):
  File "struct.py", line 13, in <module>
ModuleNotFoundError: No module named '_struct'
[104655] Module object for pyimod02_archive is NULL!
Traceback (most recent call last):
  File "PyInstaller/loader/pyimod02_archive.py", line 30, in <module>
ModuleNotFoundError: No module named 'struct'
[104655] Module object for pyimod03_importers is NULL!
Traceback (most recent call last):
  File "PyInstaller/loader/pyimod03_importers.py", line 26, in <module>
ModuleNotFoundError: No module named 'pyimod02_archive'
Traceback (most recent call last):
  File "PyInstaller/loader/pyiboot01_bootstrap.py", line 17, in <module>
ModuleNotFoundError: No module named 'pyimod03_importers'
[104655] Failed to execute script 'pyiboot01_bootstrap' due to unhandled exception!

➜  dist ./vip_movie

[105048] Module object for struct is NULL!
Traceback (most recent call last):
  File "struct.py", line 13, in <module>
ModuleNotFoundError: No module named '_struct'
[105048] Module object for pyimod02_archive is NULL!
Traceback (most recent call last):
  File "PyInstaller/loader/pyimod02_archive.py", line 30, in <module>
ModuleNotFoundError: No module named 'struct'
[105048] Module object for pyimod03_importers is NULL!
Traceback (most recent call last):
  File "PyInstaller/loader/pyimod03_importers.py", line 26, in <module>
ModuleNotFoundError: No module named 'pyimod02_archive'
Traceback (most recent call last):
  File "PyInstaller/loader/pyiboot01_bootstrap.py", line 17, in <module>
ModuleNotFoundError: No module named 'pyimod03_importers'
[105048] Failed to execute script 'pyiboot01_bootstrap' due to unhandled exception!

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值