I am trying to use a Python program with Java. My Python program is as follows:
import CostCalculatorType
import os
from Evaluate.read_input_data import *
class CostCalculator(CostCalculatorType, object):
def __init__(self):
print 'Initializing'
pass
def calculateCost(self, chromosome):
inputData = ReadInputData(chromosome, 'input_data.txt')
return inputData
I am calling this from a Java interface. I am using the following command as specified on JyNI.org:
java -cp /home/ch/jython.jar:/home/ch/JyNI.jar org.python.util.jython CostCalculator.py
java Main
I get the following error:
File "/home/ch/CostCalculator.py", line 18, in calculateCost
inputData = ReadInputData(chromosome, 'input_data.txt')
File "/usr/lib/python2.6/site-packages/Evaluate/read_input_data.py", line 21, in __init__
self.info = infoClass(0, [], [], 0.02)
File "/usr/lib/python2.6/site-packages/Evaluate/infoClass.py", line 7, in __init__
import numpy
ImportError: No module named numpy
Can NumPy be imported with JyNI at all?