weixin_45956019 2024-01-18 09:20 采纳率: 0%
浏览 3

pyinstaller打包exe

20907 INFO: Processing module hooks...
20908 INFO: Loading module hook 'hook-lxml.etree.py' from 'D:\python\lib\site-packages\_pyinstaller_hooks_contrib\hooks\stdhooks'...
Traceback (most recent call last):
File "D:\python\lib\runpy.py", line 196, in run_module_as_main
return run_code(code, main_globals, None,
File "D:\python\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "D:\python\Scripts\pyinstaller.exe_main
.py", line 7, in
File "D:\python\lib\site-packages\PyInstaller_main
.py", line 194, in console_script_run
run()
File "D:\python\lib\site-packages\PyInstaller_main
.py", line 180, in run
run_build(pyi_config, spec_file, **vars(args))
File "D:\python\lib\site-packages\PyInstaller_main
.py", line 61, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "D:\python\lib\site-packages\PyInstaller\building\build_main.py", line 1019, in main
build(specfile, distpath, workpath, clean_build)
File "D:\python\lib\site-packages\PyInstaller\building\build_main.py", line 944, in build
exec(code, spec_namespace)
File "main.spec", line 7, in
a = Analysis(
File "D:\python\lib\site-packages\PyInstaller\building\build_main.py", line 429, in init
self.postinit()
File "D:\python\lib\site-packages\PyInstaller\building\datastruct.py", line 184, in postinit
self.assemble()
File "D:\python\lib\site-packages\PyInstaller\building\build_main.py", line 596, in assemble
self.graph.process_post_graph_hooks(self)
File "D:\python\lib\site-packages\PyInstaller\depend\analysis.py", line 329, in process_post_graph_hooks
module_hook.post_graph(analysis)
File "D:\python\lib\site-packages\PyInstaller\depend\imphook.py", line 450, in post_graph
self._process_hidden_imports()
File "D:\python\lib\site-packages\PyInstaller\depend\imphook.py", line 506, in _process_hidden_imports
self.module_graph.import_hook(import_module_name, caller)
File "D:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1444, in import_hook
submodule = self._safe_import_module(head, mname, submodule)
File "D:\python\lib\site-packages\PyInstaller\depend\analysis.py", line 479, in _safe_import_module
return super()._safe_import_module(module_basename, module_name, parent_package)
File "D:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1992, in _safe_import_module
self._process_imports(n)
File "D:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2811, in _process_imports
target_modules = self._safe_import_hook(*import_info, **kwargs)
File "D:\python\lib\site-packages\PyInstaller\depend\analysis.py", line 432, in _safe_import_hook
return super()._safe_import_hook(target_module_partname, source_module, target_attr_names, level, edge_attr)
File "D:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2262, in _safe_import_hook
target_modules = self.import_hook(
File "D:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1431, in import_hook
target_package, target_module_partname = self._find_head_package(
File "D:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1610, in _find_head_package
target_package = self._safe_import_module(
File "D:\python\lib\site-packages\PyInstaller\depend\analysis.py", line 479, in _safe_import_module
return super()._safe_import_module(module_basename, module_name, parent_package)
File "D:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1992, in _safe_import_module
self._process_imports(n)
File "D:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2811, in _process_imports
target_modules = self._safe_import_hook(*import_info, **kwargs)
File "D:\python\lib\site-packages\PyInstaller\depend\analysis.py", line 432, in _safe_import_hook
return super()._safe_import_hook(target_module_partname, source_module, target_attr_names, level, edge_attr)
File "D:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2262, in _safe_import_hook
target_modules = self.import_hook(
File "D:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1431, in import_hook
target_package, target_module_partname = self._find_head_package(
File "D:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1610, in _find_head_package
target_package = self._safe_import_module(
File "D:\python\lib\site-packages\PyInstaller\depend\analysis.py", line 479, in _safe_import_module
return super()._safe_import_module(module_basename, module_name, parent_package)
File "D:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1992, in _safe_import_module
self._process_imports(n)
File "D:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2811, in _process_imports
target_modules = self._safe_import_hook(*import_info, **kwargs)
File "D:\python\lib\site-packages\PyInstaller\depend\analysis.py", line 432, in _safe_import_hook
return super()._safe_import_hook(target_module_partname, source_module, target_attr_names, level, edge_attr)
File "D:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2262, in _safe_import_hook
target_modules = self.import_hook(
File "D:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1431, in import_hook
target_package, target_module_partname = self._find_head_package(
File "D:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1610, in _find_head_package
target_package = self._safe_import_module(
File "D:\python\lib\site-packages\PyInstaller\depend\analysis.py", line 479, in _safe_import_module
return super()._safe_import_module(module_basename, module_name, parent_package)
File "D:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1992, in _safe_import_module
self._process_imports(n)
File "D:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2811, in _process_imports
target_modules = self._safe_import_hook(*import_info, **kwargs)
File "D:\python\lib\site-packages\PyInstaller\depend\analysis.py", line 432, in _safe_import_hook
return super()._safe_import_hook(target_module_partname, source_module, target_attr_names, level, edge_attr)
File "D:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2262, in _safe_import_hook
target_modules = self.import_hook(
File "D:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1444, in import_hook
submodule = self._safe_import_module(head, mname, submodule)
File "D:\python\lib\site-packages\PyInstaller\depend\analysis.py", line 479, in _safe_import_module
return super()._safe_import_module(module_basename, module_name, parent_package)
File "D:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1992, in _safe_import_module
self._process_imports(n)
File "D:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2811, in _process_imports
target_modules = self._safe_import_hook(*import_info, **kwargs)
File "D:\python\lib\site-packages\PyInstaller\depend\analysis.py", line 432, in _safe_import_hook
return super()._safe_import_hook(target_module_partname, source_module, target_attr_names, level, edge_attr)
File "D:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2262, in _safe_import_hook
target_modules = self.import_hook(
File "D:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1444, in import_hook
submodule = self._safe_import_module(head, mname, submodule)
File "D:\python\lib\site-packages\PyInstaller\depend\analysis.py", line 479, in _safe_import_module
return super()._safe_import_module(module_basename, module_name, parent_package)
File "D:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 1992, in _safe_import_module
self._process_imports(n)
File "D:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2811, in _process_imports
target_modules = self._safe_import_hook(*import_info, **kwargs)
File "D:\python\lib\site-packages\PyInstaller\depend\analysis.py", line 432, in _safe_import_hook
return super()._safe_import_hook(target_module_partname, source_module, target_attr_names, level, edge_attr)
File "D:\python\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2262, in _safe_import_hook
target_modules = self.import_hook(
yield from (i for i in get_instructions(code_object) if i.opname != "EXTENDED_ARG")
File "D:\python\lib\dis.py", line 338, in _get_instructions_bytes
argval, argrepr = _get_const_info(arg, constants)
File "D:\python\lib\dis.py", line 292, in _get_const_info
argval = const_list[const_index]
IndexError: tuple index out of range

有没有大佬知道这个是怎么回事怎么处理

  • 写回答

1条回答 默认 最新

  • Mrji1995 2024-01-18 13:13
    关注

    因为有些模块没有安装,先pip list检查一下有哪些包没有安装,或者用pip install 自己写的脚本.py

    评论 编辑记录

报告相同问题?

问题事件

  • 创建了问题 1月18日

悬赏问题

  • ¥15 Coze智能助手搭建过程中的问题请教
  • ¥15 12864只亮屏 不显示汉字
  • ¥20 三极管1000倍放大电路
  • ¥15 vscode报错如何解决
  • ¥15 前端vue CryptoJS Aes CBC加密后端java解密
  • ¥15 python随机森林对两个excel表格读取,shap报错
  • ¥15 基于STM32心率血氧监测(OLED显示)相关代码运行成功后烧录成功OLED显示屏不显示的原因是什么
  • ¥100 X轴为分离变量(因子变量),如何控制X轴每个分类变量的长度。
  • ¥30 求给定范围的全体素数p的(p-2)/p的连乘积值
  • ¥15 VFP如何使用阿里TTS实现文字转语音?