2017-05-19 4 views
1

Je cours StreamSets dans un docker sur CentOS. Essayer d'importer un paquet python dans Jython, il renvoie l'erreur suivante:Importation d'un module python dans Jython StreamSets - ImportError: aucun module nommé

SCRIPTING_05 - Script error while processing record: javax.script.ScriptException: ImportError: No module named pandas in <script> at line number 

Voici le code dans le module Jython importer mon paquet:

import sys 
sys.path.append('/path_to_my/python2.7/site-packages') 
import pandas 

Note: Depuis que je suis en StreamSets dans docker, je l'ai déjà fait en sorte que mon docker a accès à /path_to_my/python2.7/site-packages

Répondre

1

u Citant/metadaddy de ask.streamsets/168

The problem with pandas and other Python packages such as NumPy is that, even if you import the Python modules, you will not be able to use them, since they include C extensions, which cannot be loaded by Jython. There are initiatives such as JyNI that aim to bridge the gap between Jython and C extensions; SDC-7313 tracks inclusion of JyNI with the SDC Jython Evaluator.

Donc, je suppose que vous devrez contourner ce problème en utilisant une bibliothèque C indépendante.