Hi,
I have a long flat jython file and when I run it in DStudio I run into the error:
RuntimeException: java.lang.RuntimeException: Module or method too large
Please provide a CPython 2.7 bytecode file (.pyc), e.g. run python -m py_compile C:\Users\LeilyZafari\DevelopmentStudioWorkspace\csr_jython\char_training_rebooter.py
I have read that jython does not accept long modules and probably by breaking the code into functions it may run (have not tried it yet).
But when I try the code as it is with the command that is suggested in the message "python -m py_compile C:\Users\LeilyZafari\DevelopmentStudioWorkspace\csr_jython\char_training_rebooter.py" (running it in ARM DS Command Prompt), there are no errors but the file is not executed either (at least the print statements are not printed). Am I doing something wrong?
The jython script is generated from the output of our existing python scripts, so if I can still run it as it is (without breaking it into different methods) it would be much easier.
Any help would be appreciated.
Hi LeilyThe error "Module or method too large" is described at bugs.jython.org/issue2732, which says:"Large module and method compilation works only if a path to CPython 2.7 is given via a Java system property".A workaround appears to be to use e.g.:jython "-Dpython.cpython2=C:\Python\2.7.15\python.exe" large_module.pyHope this helps,Stephen
Thanks Stephen.
Where should I enter this command? When I run it in the "Command" window of DStudio, or in Arm DS Command Prompt (the default location) it does not recognize "jython". I assume I should add the path to jython but I cannot find it. Could you please advise?
Hi LeilyThis command should be run in the Arm DS Command Prompt.You can download Jython from e.g. www.jython.org/download.htmlSorry, I've not been able to try this myself yet.Hope this helpsStephen