file Java libraries in scripts

8 months 1 week ago #5021 by jlroviramartin
Hello.

I'm trying to import a jar file in a script but it doesn't work:
For example:

1- sys.path.append( "<pathtojar>/commons-math3-3.6.1.jar" )
2-
3- from org.apache.commons.math3.analysis import FunctionUtils


And the error that I get is:

ImportError: No module named apache in <script> at line number 3
Traceback (most recent call last):
File "<script>", line 3, in <module>
ImportError: No module named apache


What's wrong with the code?

Thanks.

Please Log in or Create an account to join the conversation.

1 month 1 week ago #5421 by cma
Hello,

I am not sure it will work, but you may try to write:
sys.path.append( "<pathtojar>/commons-math3-3.6.1.jar" )
sys.add_package("org.apache.commons.math3.analysis")

from org.apache.commons.math3.analysis import FunctionUtils

Please Log in or Create an account to join the conversation.

Moderators: chmcma
Time to create page: 0.038 seconds
^ Back to Top