Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pyinstaller Recursion error: maximum recursion depth exceeded

I am trying to convert a .py to .exe using pyinstaller. When I type pyinstaller my_code.py everything seems to be working and after a couple of minutes the process stops and I get the recursion error. I have tried to create a my_code.spec file in the same folder, edit it and change the number of recursions but when I run pyinstaller apparently a new .spec is created since I can't find the sys.setrecursionlimit() command that I had previously added to the my_code.spec file. I am running all the above from the anaconda command prompt and not from the command line but I think that this is not a problem since I have tried to convert to .exe a simple "hello world" script and it works perfectly. I have python 3.6.3 installed.

like image 383
Xristos Timplalexis Avatar asked Jun 24 '18 18:06

Xristos Timplalexis


2 Answers

Please see this link:https://github.com/pyinstaller/pyinstaller/issues/2919

The issue is with python 3.6, and most issues can be resolved by downgrading to python 3.5 to use pyinstaller.

If you are using anaconda3 this can be done by opening a command prompt and running:

conda update conda

And then running:

conda install python=3.5
like image 59
alphabet5 Avatar answered Oct 07 '22 00:10

alphabet5


It's better to build a different environment for when wanting to make an executable python file. This should work to the python version your executable compiler works better. Usually, the older the python version the easiest is to compile.

like image 41
Γεώργιος Κύμινος Avatar answered Oct 07 '22 02:10

Γεώργιος Κύμινος