![]() |
Pyinstaller Maximum recursion bug - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Pyinstaller Maximum recursion bug (/thread-17219.html) |
Pyinstaller Maximum recursion bug - scales11 - Apr-02-2019 hello all. I am trying to create an executable from a simple python script containing the pandas library, but I think that I have encountered a bug. If I try to make an executable using a python script: Import pandas as pd print("hello")If use pyinstaller: pyinstaller --onefile test_script.py I get the following: "Recursion error: maximum recursion depth exceeded" I have tried adding lines such as "sys.setrecursionlimit(5000)" with numbers up to 100000 but the issue remains. Can anyone confirm the bug or offer some advice? Thanks RE: Pyinstaller Maximum recursion bug - scales11 - Apr-08-2019 Does anyone have any clue how I can fix this? RE: Pyinstaller Maximum recursion bug - perfringo - Apr-08-2019 I observe that Import pandas as pd should raise SyntaxError (due to capital letter in Import).
RE: Pyinstaller Maximum recursion bug - scales11 - Apr-08-2019 Thanks for your input. I also tried import Pandas and I get the same error... Any other advice? RE: Pyinstaller Maximum recursion bug - perfringo - Apr-08-2019 Under pyinstaller issue #2919 there are suggestions which seem to work for some scenarios. For example tracing last package being analyzed RE: Pyinstaller Maximum recursion bug - scales11 - Apr-09-2019 It appears that, like the thread, I am having issues with the "modulegraph.py" I only need to import pandas.read_csv, so I try: from pandas import read_csv and I still get the error. How can I remove or ignore that module? I am using WinPython3.5.4.1 Update: I tried uninstalling and installing modulegraph.py via pip... no change in my error. RE: Pyinstaller Maximum recursion bug - snippsat - Apr-10-2019 (Apr-09-2019, 09:26 PM)scales11 Wrote: How can I remove or ignore that module? I am using WinPython3.5.4.1Upgrade your python version,Python 3.6/3.7 and pip installation under Windows. # hello.py import pandas as pd print("hello") input('Press Enter to exit')Last line so cmd windows don't disappear,if run hello.exe from file explorer. After install Python 3.7.3,test command line. λ python -V Python 3.7.3 λ pip -V pip 19.0.3 from c:\python3.7\lib\site-packages\pip (python 3.7)Install,now that pip point to 3.7,it will only install to 3.7:pip install pyinstaller pandasRun with: E:\div_code\afoo λ pyinstaller --onefile hello.py RE: Pyinstaller Maximum recursion bug - scales11 - Apr-10-2019 Eureka! Thank you very much. Removing Winpython and installing regular python 3.7(with pip and pandas) fixed my problem! RE: Pyinstaller Maximum recursion bug - SuzanneKH09 - Nov-10-2023 For anyone else who stumbles across this: I had to add the modules in the spec file pyinstaller created because the file itself calling them was not enough. In spyder I used the console to run: ! pyinstaller yield.spec here is what the spec file looks like: # -*- mode: python ; coding: utf-8 -*- import sys sys.setrecursionlimit(sys.getrecursionlimit() * 500) a = Analysis( ['yield.py'], pathex=[], binaries=[], datas=[], hiddenimports=['pull', 'squish', 'arrange', 'pivot'], hookspath=[], hooksconfig={}, runtime_hooks=[], excludes=[], noarchive=False, ) pyz = PYZ(a.pure) exe = EXE( pyz, a.scripts, [], exclude_binaries=True, name='yield', debug=False, bootloader_ignore_signals=False, strip=False, upx=True, console=True, disable_windowed_traceback=False, argv_emulation=False, target_arch=None, codesign_identity=None, entitlements_file=None, ) coll = COLLECT( exe, a.binaries, a.datas, strip=False, upx=True, upx_exclude=[], name='yield', ) |