-
Notifications
You must be signed in to change notification settings - Fork 140
Closed
Milestone
Description
Here's my python code, I'm running into problems importing any modules. Are there any suggestions?
FWIW -- I am passing as a JVM arg inside of a docker container -Dpython.home=/graalvm/jre/languages/python
import polyglot
log = polyglot.import_value('log')
log.info("Geocoder running")
import json
log.info("Imported json")
import reverse_geocoder as rg
log.info("Imported rg")
def main():
arg = polyglot.import_value('arguments')
log.info("Python args")
log.info(arg)
lat = arguments.get(0)
lon = arguments.get(1)
log.info("Running on %s, %s" % (str(lat), str(lon)))
locations = rg.search((lat, lon))
return locations
main()
I'm seeing this error:
2018-08-20 12:44:53.050+0000 INFO Executing reverse-geocoder/python with arguments [35.577045, 51.462464] of type class java.util.ArrayList
2018-08-20 12:44:56.586+0000 INFO Geocoder running
UnicodeDecodeError: Input length = 1
at <python> __truffle_decode(Unknown)
at <python> utf_8_decode(graalvm/jre/languages/python/lib-graalpython/_codecs.py:157:5119-5159)
at <python> staticmethod.__call__(graalvm/jre/languages/python/lib-graalpython/staticmethod.py:46:2134-2163)
at <python> decode(/graalvm/jre/languages/python/lib-python/3/encodings/utf_8.py:16:244-283)
at <python> decode(graalvm/jre/languages/python/lib-graalpython/_codecs.py:112:3952-3971)
at <python> decode(graalvm/jre/languages/python/lib-graalpython/bytes.py:53:2476-2529)
at <python> SRE_Pattern._decode_string(graalvm/jre/languages/python/lib-graalpython/_sre.py:146:4973-4987)
at <python> SRE_Pattern.__init__(graalvm/jre/languages/python/lib-graalpython/_sre.py:130:4421-4455)
at <python> compile(/graalvm/jre/languages/python/lib-python/3/sre_compile.py:582-586:19292-19421)
at <python> _compile(/graalvm/jre/languages/python/lib-python/3/re.py:301:12964-12998)
at <python> compile(/graalvm/jre/languages/python/lib-python/3/re.py:233:10969-10992)
at <python> <module '/graalvm/jre/languages/python/lib-python/3/json/encoder.py'>(/graalvm/jre/languages/python/lib-python/3/json/encoder.py:20:515-540)
at <python> eval(Unknown)
at <python> exec(graalvm/jre/languages/python/lib-graalpython/functions.py:112:3611-3666)
at <python> _call_with_frames_removed(graalvm/jre/languages/python/lib-python/3/importlib/_bootstrap.py:206:6419-6434)
at <python> _LoaderBasics.exec_module(graalvm/jre/languages/python/lib-python/3/importlib/_bootstrap_external.py:687:26296-26360)
at org.graalvm.polyglot.Context.eval(Context.java:313)
at com.neo4j.magnolia.polyglot.ExternalFn.invoke(ExternalFn.java:74)
at com.neo4j.magnolia.polyglot.CallExternal.fn(CallExternal.java:102)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.neo4j.kernel.impl.proc.ReflectiveProcedureCompiler$ReflectiveUserFunction.apply(ReflectiveProcedureCompiler.java:811)
The java code that calls this python can be found here: https://github.com/moxious/magnolia/blob/master/src/main/java/com/neo4j/magnolia/polyglot/ExternalFn.java#L56
Metadata
Metadata
Assignees
Labels
No labels