[Jepp-users] python_modules
Brought to you by:
mrjohnson0
From: V. B. <var...@gm...> - 2013-03-30 17:01:06
|
Dear Mike Johnson! It's me again. I'd like to use modules in my python code. But I think jep cannot handle properly. For example: >>>from sklearn import linear_model >>>clf = linear_model.LinearRegression() >>>clf.fit ([[0, 0], [1, 1], [2, 2]], [0, 1, 2]) LinearRegression(copy_X=True, fit_intercept=True, normalize=False) >>>clf.coef_ array([ 0.5, 0.5]) Jep seems like run forever after the first line (no error message or exception), but the code works if I run it from the python interpreter 'manually'. It doesn't work neither if I use it in this way: import sklearn clf = sklearn.linear_model.LinearRegression() ...same as above... In this case I get the following error message: "SEVERE: null jep.JepException: jep.JepException: <type 'exceptions.AttributeError'>: 'module' object has no attribute 'linear_model' at jep.Jep.eval(Jep.java:294) at Main.executeScript(Main.java:72) at Main.main(Main.java:36) Caused by: jep.JepException: <type 'exceptions.AttributeError'>: 'module' object has no attribute 'linear_model' at jep.Jep.eval(Native Method) at jep.Jep.eval(Jep.java:278) ... 2 more" My only working version with modules is: import numpy as np beta = np.array([1, 0.1, 10]) So I need a solution in order to - use code: 'module.submodule.subsubmodule' - use import: 'import module.submodule' and use code: 'submodule.subsubmodule' If one of these solutions work, I would be happy. Is it possible? I'm using python 2.7.2 and jep 2.4. I know there's a newer version of jep but for me it was hard to configure 2.4. too, so I wouldn't install a newer if it's unnecessary. (Because it was time consuming for me. I had to compile a totally new python interpreter with ucs4, copy the installed python packages from dist-packages to site-packages, set environment variables and so on.) Yours sincerely, Balazs Varhegyi |