[GH-ISSUE #215] IndexError: tuple index out of range (Python 3.10) #196

Closed
opened 2026-02-26 12:20:47 +03:00 by kerem · 14 comments
Owner

Originally created by @brentvollebregt on GitHub (Nov 16, 2021).
Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/215

Recently PyInstaller 4.6 was released which added support for Python 3.10. As of auto-py-to-exe v2.11.0, PyInstaller 4.6 is a requirement.

It has been noted that PyInstaller 4.6 does not fully support Python 3.10 due to a bug in CPython. The PyInstaller discussion related to this issue can be found here and the associated CPython bug can be found here.

This bug cannot be fixed in auto-py-to-exe or PyInstaller so we must wait for a new Python 3.10.x release with a fix.

Originally created by @brentvollebregt on GitHub (Nov 16, 2021). Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/215 Recently PyInstaller 4.6 was released which added support for Python 3.10. As of auto-py-to-exe v2.11.0, PyInstaller 4.6 is a requirement. It has been [noted](https://github.com/brentvollebregt/auto-py-to-exe/issues/205#issuecomment-958462879) that PyInstaller 4.6 does not fully support Python 3.10 due to a bug in CPython. The PyInstaller discussion related to this issue can be found [here](https://github.com/pyinstaller/pyinstaller/issues/6301) and the associated CPython bug can be found [here](https://bugs.python.org/issue45757). This bug cannot be fixed in auto-py-to-exe or PyInstaller so we must wait for a new Python 3.10.x release with a fix.
kerem closed this issue 2026-02-26 12:20:48 +03:00
Author
Owner

@Barak911 commented on GitHub (Nov 24, 2021):

I found a solution to this problem.
This is a python 3.10 bug, and after applying the fix everything related to pyinstaller started working properly.

"
so basically you have to go to the folder "Python310\Lib" and edit the file 'dis.py'.
In the 'dis.py' file you have to find this "def _unpack_opargs" and inside the else statement write a new line with this: "extended_arg = 0".

I did something like that:

    else:
        arg = None
        extended_arg = 0 
    yield (i, op, arg)

and everything is working fine now.
"
https://github.com/pyinstaller/pyinstaller/issues/6301#issuecomment-974927257

<!-- gh-comment-id:977992924 --> @Barak911 commented on GitHub (Nov 24, 2021): **I found a solution to this problem.** This is a python 3.10 bug, and after applying the fix everything related to pyinstaller started working properly. " so basically you have to go to the folder "Python310\Lib" and edit the file 'dis.py'. In the 'dis.py' file you have to find this "def _unpack_opargs" and inside the else statement write a new line with this: "extended_arg = 0". I did something like that: else: arg = None extended_arg = 0 yield (i, op, arg) and everything is working fine now. " https://github.com/pyinstaller/pyinstaller/issues/6301#issuecomment-974927257
Author
Owner

@ghost commented on GitHub (Dec 22, 2021):

extended_arg = 0

TSYM Worked perfectly!!

<!-- gh-comment-id:999215491 --> @ghost commented on GitHub (Dec 22, 2021): > extended_arg = 0 TSYM Worked perfectly!!
Author
Owner

@brentvollebregt commented on GitHub (Jan 8, 2022):

Python 3.10.1 fixes this now and I have added a warning to auto-py-to-exe in 2.14.0. Closing as this is no longer an issue regarding Python 3.10.1 is not used.

<!-- gh-comment-id:1007947402 --> @brentvollebregt commented on GitHub (Jan 8, 2022): Python 3.10.1 fixes this now and I have added a warning to auto-py-to-exe in 2.14.0. Closing as this is no longer an issue regarding Python 3.10.1 is not used.
Author
Owner

@4ggm commented on GitHub (Jan 22, 2022):

pls help

<!-- gh-comment-id:1019236036 --> @4ggm commented on GitHub (Jan 22, 2022): pls help
Author
Owner

@bobbob8113 commented on GitHub (Mar 21, 2022):

yo

<!-- gh-comment-id:1073387290 --> @bobbob8113 commented on GitHub (Mar 21, 2022): yo
Author
Owner

@bobbob8113 commented on GitHub (Mar 21, 2022):

i can't find so basically you have to go to the folder "Python310\Lib" and edit the file 'dis.py'.
In the 'dis.py' file you have to find this "def _unpack_opargs" and inside the else statement write a new line with this: "extended_arg = 0".

<!-- gh-comment-id:1073387421 --> @bobbob8113 commented on GitHub (Mar 21, 2022): i can't find so basically you have to go to the folder "Python310\Lib" and edit the file 'dis.py'. In the 'dis.py' file you have to find this "def _unpack_opargs" and inside the else statement write a new line with this: "extended_arg = 0".
Author
Owner

@brentvollebregt commented on GitHub (Mar 21, 2022):

@bobbob8113 I recommend upgrading to Python 3.10.1 or above if you have the option to

<!-- gh-comment-id:1073465014 --> @brentvollebregt commented on GitHub (Mar 21, 2022): @bobbob8113 I recommend upgrading to Python 3.10.1 or above if you have the option to
Author
Owner

@bobbob8113 commented on GitHub (Mar 21, 2022):

I have python 3.10.4 and it still give the same errors

<!-- gh-comment-id:1074402764 --> @bobbob8113 commented on GitHub (Mar 21, 2022): I have python 3.10.4 and it still give the same errors
Author
Owner

@brentvollebregt commented on GitHub (Mar 22, 2022):

@bobbob8113 you may have Python 3.10.4, but are you 100% sure it's being used? Did you previously (or still do) have Python 3.10.0 installed?

<!-- gh-comment-id:1074941752 --> @brentvollebregt commented on GitHub (Mar 22, 2022): @bobbob8113 you may have Python 3.10.4, but are you 100% sure it's being used? Did you previously (or still do) have Python 3.10.0 installed?
Author
Owner

@bobbob8113 commented on GitHub (Mar 25, 2022):

Ye previsously but i update alrdy and using anaconda

<!-- gh-comment-id:1078522156 --> @bobbob8113 commented on GitHub (Mar 25, 2022): Ye previsously but i update alrdy and using anaconda
Author
Owner

@brentvollebregt commented on GitHub (Mar 25, 2022):

@bobbob8113 are there any warnings at the top of auto-py-to-exe? Maybe something that says "You are using Python 3.10.0. This version of Python has a bug that causes PyInstaller to fail."?

<!-- gh-comment-id:1078680670 --> @brentvollebregt commented on GitHub (Mar 25, 2022): @bobbob8113 are there any warnings at the top of auto-py-to-exe? Maybe something that says "You are using Python 3.10.0. This version of Python has a bug that causes PyInstaller to fail."?
Author
Owner

@lloydyu24 commented on GitHub (Jun 2, 2022):

Why am I still getting the "You are using Python 3.10.0. This version of Python has a bug that causes PyInstaller to fail.
Please upgrade to Python 3.10.1 or above." message after updating my Python to the latest Python 3.10.4?

<!-- gh-comment-id:1144493133 --> @lloydyu24 commented on GitHub (Jun 2, 2022): Why am I still getting the "You are using Python 3.10.0. This version of Python has a bug that causes PyInstaller to fail. Please upgrade to Python 3.10.1 or above." message after updating my Python to the latest Python 3.10.4?
Author
Owner

@brentvollebregt commented on GitHub (Jun 2, 2022):

@lloydyu24 the line that controls that message is here - the only way you can get the message is if you are running Python 3.10.0.

Maybe you have installed another installation of Python (3.10.4) but are still running auto-py-to-exe with the previous installation (3.10.0).

<!-- gh-comment-id:1144697185 --> @brentvollebregt commented on GitHub (Jun 2, 2022): @lloydyu24 the line that controls that message [is here](https://github.com/brentvollebregt/auto-py-to-exe/blob/master/auto_py_to_exe/utils.py#L96) - the only way you can get the message is if you are running Python 3.10.0. Maybe you have installed another installation of Python (3.10.4) but are still running auto-py-to-exe with the previous installation (3.10.0).
Author
Owner

@shinyong1 commented on GitHub (Jun 21, 2025):

바라크911
감사합니다. 덕붙에 문제를 해결했습니다.
ChatGpt에도 해결방안이 없었는데 ... 감사합니다.

이 문제에 대한 해결책을 찾았습니다. 이는 Python 3.10 버그이며, 수정 사항을 적용한 후 pyinstaller 관련 모든 것이 제대로 작동하기 시작했습니다.

" 즉, 기본적으로 "Python310\Lib" 폴더로 가서 'dis.py' 파일을 편집해야 합니다. 'dis.py' 파일에서 "def _unpack_opargs"를 찾아 else 문 안에 "extended_arg = 0"이라는 새 줄을 작성해야 합니다.

저는 다음과 같은 일을 했습니다.

    else:
        arg = None
        extended_arg = 0 
    yield (i, op, arg)

그리고 지금은 모든 것이 잘 작동하고 있습니다. " pyinstaller/pyinstaller#6301 (주석)

바라크911 감사합니다. 에러를 잘 해결 했습니다. 너무 너무 감사합니다.

<!-- gh-comment-id:2993399391 --> @shinyong1 commented on GitHub (Jun 21, 2025): [바라크911](https://github.com/Barak911) 감사합니다. 덕붙에 문제를 해결했습니다. ChatGpt에도 해결방안이 없었는데 ... 감사합니다. > **이 문제에 대한 해결책을 찾았습니다.** 이는 Python 3.10 버그이며, 수정 사항을 적용한 후 pyinstaller 관련 모든 것이 제대로 작동하기 시작했습니다. > > " 즉, 기본적으로 "Python310\Lib" 폴더로 가서 'dis.py' 파일을 편집해야 합니다. 'dis.py' 파일에서 "def _unpack_opargs"를 찾아 else 문 안에 "extended_arg = 0"이라는 새 줄을 작성해야 합니다. > > 저는 다음과 같은 일을 했습니다. > > ``` > else: > arg = None > extended_arg = 0 > yield (i, op, arg) > ``` > > 그리고 지금은 모든 것이 잘 작동하고 있습니다. " [pyinstaller/pyinstaller#6301 (주석)](https://github.com/pyinstaller/pyinstaller/issues/6301#issuecomment-974927257) [바라크911](https://github.com/Barak911) 감사합니다. 에러를 잘 해결 했습니다. 너무 너무 감사합니다.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/auto-py-to-exe#196
No description provided.