- File "C:\Users\xx\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2645, in _scan_code
- self._scan_bytecode(
- File "C:\Users\xx\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py", line 2749, in _scan_bytecode
- for inst in util.iterate_instructions(module_code_object):
- File "C:\Users\xx\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\util.py", line 147, in iterate_instructions
- yield from iterate_instructions(constant)
- File "C:\Users\xx\AppData\Local\Programs\Python\Python310\lib\site-packages\PyInstaller\lib\modulegraph\util.py", line 139, in iterate_instructions
- yield from get_instructions(code_object)
- File "C:\Users\xx\AppData\Local\Programs\Python\Python310\lib\dis.py", line 338, in _get_instructions_bytes
- argval, argrepr = _get_const_info(arg, constants)
- File "C:\Users\xx\AppData\Local\Programs\Python\Python310\lib\dis.py", line 292, in _get_const_info
- argval = const_list[const_index]
複製代碼
運行環境
- win10
- python3.10
- pycharm2021
複製代碼
解決方案:- 定位到C:\Users\hp\AppData\Local\Programs\Python\Python310\Lib\dis.py(每個人的路徑可能不同)
- 找到_unpack_opargs(code)函數
- 在else中加入extended_arg = 0語句
- 如圖
Python PyInstaller 打包 exe tuple
文章出處: NetYea 網頁設計 |