A compatibility issue between jaydebeapi and jpype

18 Views Asked by At

The problem rises in a complex program. It is simplified and rebuilt in Jupyter now.

It has three cells.

Cell 1: import package

Cell 2: make an access to mysql through Jaydebeapi

Cell 3: call a function in Jars.

enter image description here

  1. when runngins cells in the order: Cell 1, Cell 2 and Cell3

    Cell 2 works well, but Cell 3 does not.

    A JVM has was created in Cell2. So in Cell 3, the jar_path and jar_dependency_path can not be add into the JVM, which lead into jpype.JClass() can not find class.

    By now, I solved the jpype.JClass() problem by adding jars into Environment Variables, but i don't know how to add dependency_path into Environment Variables.

enter image description here

  1. when running cells in the order Cell 1, Cell 3 and Cell 2

    Cell 3 is called before Cell 2, so it can create a JVM with all jars and dependency it needs. But Cell 2 can not run. I think it has the same problem in the above.

enter image description here

How can I fix the problem. Thanks a lot.

By now, I solved the jpype.JClass() problem by adding jars into Environment Variables, but i don't know how to add dependency_path into Environment Variables.

I want to use jaydebeapi and jpype both in a right way.

0

There are 0 best solutions below