【发布时间】:2021-11-30 09:36:23
【问题描述】:
> C:\Users\Studio\Desktop\New folder>python -m PyInstaller PSEClient.py
> --icon=primeparts.ico --noconsole -F 78 INFO: PyInstaller: 4.7 78 INFO: Python: 3.10.0 93 INFO: Platform: Windows-10-10.0.19043-SP0 93
> INFO: wrote C:\Users\Studio\Desktop\New folder\PSEClient.spec 93 INFO:
> UPX is not available. 93 INFO: Extending PYTHONPATH with paths
> ['C:\\Users\\Studio\\Desktop\\New folder'] 328 INFO: checking Analysis
> 328 INFO: Building Analysis because Analysis-00.toc is non existent
> 328 INFO: Initializing module dependency graph... 328 INFO: Caching
> module graph hooks... 343 INFO: Analyzing base_library.zip ... 3171
> INFO: Processing pre-find module path hook distutils from
> 'C:\\Users\\Studio\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-distutils.py'.
> 3171 INFO: distutils: retargeting to non-venv dir
> 'C:\\Users\\Studio\\AppData\\Local\\Programs\\Python\\Python310\\lib'
> 4218 INFO: Caching module dependency graph... 4359 INFO: running
> Analysis Analysis-00.toc 4375 INFO: Adding
> Microsoft.Windows.Common-Controls to dependent assemblies of final
> executable required by
> C:\Users\Studio\AppData\Local\Programs\Python\Python310\python.exe
> 4421 INFO: Analyzing C:\Users\Studio\Desktop\New folder\PSEClient.py
> 5734 INFO: Processing pre-find module path hook site from
> 'C:\\Users\\Studio\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-site.py'.
> 5734 INFO: site: retargeting to fake-dir
> 'C:\\Users\\Studio\\AppData\\Local\\Programs\\Python\\Python310\\lib\\site-packages\\PyInstaller\\fake-modules'
> Traceback (most recent call last): File
> "C:\Users\Studio\AppData\Local\Programs\Python\Python310\lib\runpy.py",
> line 196, in _run_module_as_main
> return _run_code(code, main_globals, None, File "C:\Users\Studio\AppData\Local\Programs\Python\Python310\lib\runpy.py",
> line 86, in _run_code
> exec(code, run_globals) File "C:\Users\Studio\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\__main__.py",
> line 134, in <module>
> run() File "C:\Users\Studio\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\__main__.py",
> line 124, in run
> run_build(pyi_config, spec_file, **vars(args)) File "C:\Users\Studio\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\__main__.py",
> line 58, in run_build
> argval = const_list[const_index] IndexError: tuple index out of range
输出已被裁剪。
我不知道发生了什么。 更新 Python 后,每次我尝试都会发生这种情况 使这个特定的脚本成为可执行文件。 该脚本运行完美,没有任何问题,但 PyInstaller 输出
IndexError: 元组索引超出范围
Auto-py-to-exe 也是如此。
在更新之前,我可以毫无问题地制作 exe。
有什么想法吗? 提前致谢
【问题讨论】:
-
出于内容质量的考虑,Stack Overflow 不允许重复提问。请根据How to Ask 在此处发布之前使用您首选的搜索引擎研究您的询问。这是IndexError: tuple index out of range when I try to create an executable from a python script using auto-py-to-exe 的副本
-
我将 python 升级到 3.10.2 并在使用 pyinstaller 时解决了这个问题
标签: python pyinstaller upgrade executable script