2017-07-01 7 views
0

私はJythonを初めて使いました.Jythonを使ってPythonクラスを実行しようとしています。しかし、私はいくつかの問題に取り組んでいます。私は "demisto" モジュールを定義したが、ImportError:モジュールがdemyoという名前のモジュールがありません

File "C:\Users\AlokNath\Desktop\Demisto_Project\demisto-py-master\demisto\SimpleConnect.py", line 3, in <module> import demisto ImportError: No module named demisto

:javaファイルを実行中

The Java class that I've defined:

public class DemistoCalls { 

    PythonInterpreter interpreter = null; 


    public DemistoCalls() 
    { 
     PythonInterpreter.initialize(System.getProperties(), 
       System.getProperties(), new String[0]); 

     this.interpreter = new PythonInterpreter(); 
    } 

    void execfile(final String fileName) 
    { 
     this.interpreter.execfile(fileName); 
    } 

    PyInstance createClass(final String className, final String opts) 
    { 
     return (PyInstance) this.interpreter.eval(className + "(" + opts + ")"); 
    } 

    public static void main(String[] args) { 
     DemistoCalls demistoCalls = new DemistoCalls(); 

     demistoCalls.execfile("C:\\Users\\AlokNath\\Desktop\\Demisto_Project\\demisto-py-master\\demisto\\SimpleConnect.py"); 

    } 

} 

The SampleConnect.py file that I'm trying to run:

import sys 
sys.path.append("C:\Users\AlokNath\Desktop\Demisto_Project\demisto-py- 
master\demisto") 
import demisto 

、私はこのエラーを取得していますPythonのシステムパスにJython 2.7.lb2ライブラリへの適切なパスが含まれていることを確認します。どこが間違っているのか分かりません。どんな助けもありがとうございます。

よろしく、 Alok

答えて

0

私は、インポートエラー問題への解決策を見つけました。不足しているモジュールを "modeler-installation/lib/jython/Lib"の "site-packages"フォルダにコピーする必要があります。これにより、依存関係の問題が解決されます。

関連する問題