将Python及其库与Java集成 [英] Integrate Python and his libraries with Java
问题描述
我将Python和Java与Jython集成在一起,但是我需要一些库(pandas,numpy,skfuzzy,matplotlib,sklearn,pickle),但是Jython无法支持其中的一些库.
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.
是否有可能从Jython导入库或存在其他Framework,语言,库,这些库可以与Python库完全集成.
Is it possible import that libraries from Jython or exist other Framework, language, library, something that afford a complete integrate with Python libraries.
推荐答案
不幸的是,像numpy
和scipy
这样的软件包的代码包括用Fortran和C这样的语言编写的扩展模块,这些模块是专门为CPython解释器量身定制的.这使得它们与不支持CPython扩展接口的Jython不兼容.
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.
您可能要做的最好的事情就是让Java程序与您可以用CPython编写的本地托管Python服务器使用某种基于网络的通信,但是这可能会导致效率低下,这取决于所需的程序结构.
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.
这篇关于将Python及其库与Java集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!