-1

I integrate Python and Java with Jython but I need some libraries(pandas, numpy, skfuzzy, matplotlib, sklearn, pickle) but Jython can't support some of them.

Is it possible import that libraries from Jython or exist other Framework, language, library, something that afford a complete integrate with Python libraries.

1 Answers1

1

Unfortunately the code for packages like numpy and scipy includes extension modules written in languages like Fortran and C, which are specifically tailored to the CPython interpreter. That makes them incompatible with Jython, which does not support the CPython extension interface.

Probably the best you could do would be to have your Java programs use some sort of network-based communications with a locally-hosted Python server that you could write in CPython, but that might introduce unacceptable inefficiencies, depending on the necessary program structure.

holdenweb
  • 33,305
  • 7
  • 57
  • 77
  • have u found something for this? I have these requirements: **(1)** call python functions from *.py file from java code & send arguments & receive return values from it transparently without requiring to modify given *.py file. **(2)** use pandas and numpy and other standard/widely used libraries as transparently as possible. I created these threads:[1](http://stackoverflow.com/questions/39470221/calling-python-functions-from-py-files-from-java-and-passing-and-returning),[2](http://stackoverflow.com/questions/39410339/different-better-approaches-for-calling-python-function-from-java) for same – Mahesha999 Sep 14 '16 at 13:02
  • You should investigate RPC (remote procedure call) libraries in Jython-compatible Python as your best bet. Of course, if the processes communicating over the network are running on the same machine then the networking overhead, while still a perceptible source of inefficiency, will be much lower. – holdenweb Aug 19 '17 at 11:18