Script too large to compile

Asked by xyz_User on 2020-03-28

Trying to compile my old code into a runnable JAR file

Receving this error as the scrip is too large I believe:

java.lang.RuntimeException: java.lang.RuntimeException: Encountered too large method code in C:\Users\user7643\AppData\Roaming\Sikulix\SetupStuff\scriptCompiled\automationV1.py Please provide a CPython 2.7 bytecode file (.pyc) to proceed

What exactly does it mean by please provide a CPythin bytecode?

I did compile the script via: python -m py_compile and have the .pyc file (get auto rename to: automationV1.cpython-38)

What exactly is the next step to compile it now, where do I put this file?

Thank you!

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
2020-03-29
Last query:
2020-03-29
Last reply:
2020-03-28
xyz_User (userseven) said : #1

Looks like had python 3 installed, I've compiled it with python 2

but now I'm getting a different error:

[error] JythonSupport: exec: returns: Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Users\user7643\AppData\Roaming\Sikulix\Lib\compileall.py", line 50, in compile_dir if not compile_file(fullname, ddir, force, rx, quiet): File "C:\Users\user7643\AppData\Roaming\Sikulix\Lib\compileall.py", line 99, in compile_file ok = py_compile.compile(fullname, None, dfile, True) File "C:\Users\Humayun\AppData\Roaming\Sikulix\Lib\compileall.py", line 99, in compile_file ok = py_compile.compile(fullname, None, dfile, True) File "C:\Users\user7643\AppData\Roaming\Sikulix\Lib\py_compile.py", line 96, in compile _py_compile.compile(file, cfile, dfile) File "C:\Users\user7643\AppData\Roaming\Sikulix\Lib\py_compile.py", line 96, in compile _py_compile.compile(file, cfile, dfile) at org.python.compiler.Module.serializePyBytecode(Module.java:867)
at org.python.compiler.Module.compile(Module.java:989)
at org.python.core.imp.compileSource(imp.java:370)
at org.pytho

n.core.imp.compileSource(imp.java:296)
at org.python.modules._py_compile.compile(_py_compile.java:37)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter

Best RaiMan (raimund-hocke) said : #2

Not sure, what you are doing.

SikuliX scriptcode has to be compiled with Jython 2.7.

xyz_User (userseven) said : #3

Thanks RaiMan, that solved my question.