亚洲精品久久久中文字幕-亚洲精品久久片久久-亚洲精品久久青草-亚洲精品久久婷婷爱久久婷婷-亚洲精品久久午夜香蕉

您的位置:首頁技術文章
文章詳情頁

python - 用Pyinstaller打包時出現IndexError怎么回事?

瀏覽:103日期:2022-07-10 10:41:37

問題描述

在我的package里面有個game.py寫好的,然后用pyinstaller打包就出現了下面的情況:

C:package>pyinstaller -F game.py166 INFO: PyInstaller: 3.2.1166 INFO: Python: 3.6.1166 INFO: Platform: Windows-10-10.0.14393-SP0166 INFO: wrote C:packagegame.spec182 INFO: UPX is not available.182 INFO: Extending PYTHONPATH with paths[’C:package’, ’C:package’]182 INFO: checking Analysis182 INFO: Building Analysis because out00-Analysis.toc is non existent182 INFO: Initializing module dependency graph...199 INFO: Initializing module graph hooks...202 INFO: Analyzing base_library.zip ...Traceback (most recent call last): File 'C:Python36Scriptspyinstaller-script.py', line 11, in <module> load_entry_point(’PyInstaller==3.2.1’, ’console_scripts’, ’pyinstaller’)() File 'C:Python36libsite-packagespyinstaller-3.2.1-py3.6.eggPyInstaller__main__.py', line 90, in run run_build(pyi_config, spec_file, **vars(args)) File 'C:Python36libsite-packagespyinstaller-3.2.1-py3.6.eggPyInstaller__main__.py', line 46, in run_build PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs) File 'C:Python36libsite-packagespyinstaller-3.2.1-py3.6.eggPyInstallerbuildingbuild_main.py', line 788, in main build(specfile, kw.get(’distpath’), kw.get(’workpath’), kw.get(’clean_build’)) File 'C:Python36libsite-packagespyinstaller-3.2.1-py3.6.eggPyInstallerbuildingbuild_main.py', line 734, in build exec(text, spec_namespace) File '<string>', line 16, in <module> File 'C:Python36libsite-packagespyinstaller-3.2.1-py3.6.eggPyInstallerbuildingbuild_main.py', line 212, in __init__ self.__postinit__() File 'C:Python36libsite-packagespyinstaller-3.2.1-py3.6.eggPyInstallerbuildingdatastruct.py', line 161, in __postinit__ self.assemble() File 'C:Python36libsite-packagespyinstaller-3.2.1-py3.6.eggPyInstallerbuildingbuild_main.py', line 317, in assemble excludes=self.excludes, user_hook_dirs=self.hookspath) File 'C:Python36libsite-packagespyinstaller-3.2.1-py3.6.eggPyInstallerdependanalysis.py', line 560, in initialize_modgraph graph.import_hook(m) File 'C:Python36libsite-packagespyinstaller-3.2.1-py3.6.eggPyInstallerlibmodulegraphmodulegraph.py', line 1509, in import_hook source_package, target_module_partname, level) File 'C:Python36libsite-packagespyinstaller-3.2.1-py3.6.eggPyInstallerlibmodulegraphmodulegraph.py', line 1661, in _find_head_package target_module_headname, target_package_name, source_package) File 'C:Python36libsite-packagespyinstaller-3.2.1-py3.6.eggPyInstallerdependanalysis.py', line 209, in _safe_import_module module_basename, module_name, parent_package) File 'C:Python36libsite-packagespyinstaller-3.2.1-py3.6.eggPyInstallerlibmodulegraphmodulegraph.py', line 2077, in _safe_import_module module_name, file_handle, pathname, metadata) File 'C:Python36libsite-packagespyinstaller-3.2.1-py3.6.eggPyInstallerlibmodulegraphmodulegraph.py', line 2167, in _load_module self._scan_code(m, co, co_ast) File 'C:Python36libsite-packagespyinstaller-3.2.1-py3.6.eggPyInstallerlibmodulegraphmodulegraph.py', line 2585, in _scan_code module, module_code_object, is_scanning_imports=False) File 'C:Python36libsite-packagespyinstaller-3.2.1-py3.6.eggPyInstallerlibmodulegraphmodulegraph.py', line 2831, in _scan_bytecode global_attr_name = get_operation_arg_name() File 'C:Python36libsite-packagespyinstaller-3.2.1-py3.6.eggPyInstallerlibmodulegraphmodulegraph.py', line 2731, in get_operation_arg_name return module_code_object.co_names[co_names_index]IndexError: tuple index out of range

Traceback顯示應該不是我的game.py的問題。請問這是怎么了?安裝的是最新版的pyinstaller3.2.1版本,Python是3.6版本的。

問題解答

回答1:

Python 3.6: IndexError: tuple index out of range, 上面提到

RTFM: PyInstaller 3.2.1 does not support Python 3.6

也就是pyinstaller3.2.1不支持Python 3.6.

回答2:

建議pyinstaller不要用最新的python版本,至少python3.5以下版本是可行的。

回答3:

支持3.6的還沒有放出,但是可以手動安裝https://github.com/pyinstalle... 下載zip后把PyInstaller提出來。刪掉python/Lib/site-packages/PyInstaller 文件夾,把解壓得到的PyInstaller放進去應該就OK了。#_#

標簽: Python 編程
相關文章:
主站蜘蛛池模板: 欧美日韩一区二区视频图片 | 大陆三级特黄在线播放 | 一级特黄性色生活片一区二区 | 黄页网址免费 | 99精品国产兔费观看66 | 好男人在线影院www 好看的一级毛片 | 黄色在线观看www | 操比大片| 中文字幕综合久久久久 | 久久久久久尹人网香蕉 | 国产欧美日韩精品a在线观看高清 | 国产一级毛片亚洲久留木玲 | 国产色婷婷亚洲99精品小说 | 日韩在线视频免费观看 | 久久草草 | 久久美女精品国产精品亚洲 | 九九99热久久精品在线6手机 | 三级国产精品 | 亚洲国产精品日韩一线满 | 亚洲无线乱码高清在线观看一区 | 92午夜影院 | 91视频一88av | 亚洲丁香| 日韩美女网站在线看 | 久久精品99成人中文字幕880 | 国产曰批视频免费观看完 | 久久中文字幕制服丝袜美腿 | 精品中文字幕制服中文 | 黄色免费一级视频 | 香蕉片视频在线观看 | 黄色影院 | 国产亚洲精品va在线 | 日操夜操天天操 | 日本中文字幕精品理论在线 | 九九99 | 亚洲另类视频 | 国产免费区 | 一区二区三区中文国产亚洲 | 亚洲精品国产第一区第二区国 | 尤物网在线视频 | 色婷婷综合欧美成人 |