bio-ontology-research-group / mowl

mOWL: Machine Learning library with Ontologies
BSD 3-Clause "New" or "Revised" License
54 stars 4 forks source link

Cannot find gateway #18

Closed leechuck closed 1 year ago

leechuck commented 2 years ago

Hello,

I installed mowl using pip according to the instructions on the website, but when I try to run the first example I get:

File ~/.pyenv/versions/3.9.13/lib/python3.9/site-packages/mowl/datasets/__init__.py:7, in <module>
      5 dirname = os.path.dirname(__file__)
      6 jars_dir = os.path.join(dirname, "../../gateway/build/distributions/gateway/lib/")
----> 7 jars = f'{str.join(":", [jars_dir + name for name in os.listdir(jars_dir)])}'
      9 if not jpype.isJVMStarted():
     10     jpype.startJVM(
     11         jpype.getDefaultJVMPath(), "-ea",
     12         "-Xmx10g",
     13         "-Djava.class.path=" + jars,
     14         convertStrings=False)

FileNotFoundError: [Errno 2] No such file or directory: '/home/leechuck/.pyenv/versions/3.9.13/lib/python3.9/site-packages/mowl/datasets/../../gateway/build/distributions/gateway/lib/'

Do I need to install another package?

leechuck commented 2 years ago

After building from source, this works, but I then get:

java.lang.ClassNotFoundException: java.lang.ClassNotFoundException: org.mowl.Parsers

There does not seem to be a jar file built from the scala files.

Thrameos commented 2 years ago

Minor nit... the failure point for this error shows this package is using an outdated pattern of directly calling startJVM with -Djava.class.path rather than using the classpath keyword argument. As formulated it is not portable as Windows uses ; and unix uses :. Please place an issue upstream to revise the start command. Sending a list of paths will automatically join with the proper separator.