Indexerror: Tuple Index Out of Range When Using Py2Exe

IndexError: tuple index out of range when I try to create an executable from a python script using auto-py-to-exe

This is a Python 3.10 issue.
To fix it:
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", then save the file.

I did something like that:

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

and everything is working fine now.

I found the solution here:
https://bugs.python.org/issue45757
https://github.com/pyinstaller/pyinstaller/issues/6301

Error tuple index out of range for matrix preprocess

input2 has shape (3,). Try to reshape it before function call:

input2 = input2.reshape(1,-1)

or otherwise add some check code at the very start of the function body:

def updated_x (input_x):

if len(input_x.shape)<2:
input_x = input_x.reshape(1,-1)
#..........
#..........


Related Topics



Leave a reply



Submit