TShopping
標題:
Python用PyInstaller打包成exe時報錯:tuple index out of range
[打印本頁]
作者:
woff
時間:
2023-10-31 22:04
標題:
Python用PyInstaller打包成exe時報錯:tuple index out of range
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語句
如圖
tuple01.png
(51.68 KB, 下載次數: 1)
下載附件
保存到相冊
Python PyInstaller 打包 exe tuple
2023-10-31 22:04 上傳
文章出處:
NetYea 網頁設計
歡迎光臨 TShopping (http://www.tshopping.com.tw/)
Powered by Discuz! X3.2