pentaho-labs / pentaho-cpython-plugin

This is a PDI plugin that allows execution of Python code.
Apache License 2.0
33 stars 21 forks source link

Failed to invoke python #3

Closed Prussia closed 8 years ago

Prussia commented 8 years ago

Installed Anaconda 2 on docker. No python on path. Dockerfile is on the page https://hub.docker.com/r/prussia2016/docker-pentaho-pdi/ Stack information is as follows CPython Script Executor.0 - Cannot run program "python": error=2, No such file or directory 2016/09/07 06:19:20 - CPython Script Executor.0 - 2016/09/07 06:19:20 - CPython Script Executor.0 - at org.pentaho.python.PythonSession.initSession(PythonSession.java:363) 2016/09/07 06:19:20 - CPython Script Executor.0 - at org.pentaho.di.trans.steps.cpythonscriptexecutor.CPythonScriptExecutorData.initPython(CPythonScriptExecutorData.java:560) 2016/09/07 06:19:20 - CPython Script Executor.0 - at org.pentaho.di.trans.steps.cpythonscriptexecutor.CPythonScriptExecutor.init(CPythonScriptExecutor.java:112) 2016/09/07 06:19:20 - CPython Script Executor.0 - at org.pentaho.di.trans.step.StepInitThread.run(StepInitThread.java:69) 2016/09/07 06:19:20 - CPython Script Executor.0 - at java.lang.Thread.run(Thread.java:745) 2016/09/07 06:19:20 - CPython Script Executor.0 - Caused by: java.io.IOException: Cannot run program "python": error=2, No such file or directory 2016/09/07 06:19:20 - CPython Script Executor.0 - at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) 2016/09/07 06:19:20 - CPython Script Executor.0 - at org.pentaho.python.PythonSession.(PythonSession.java:231) 2016/09/07 06:19:20 - CPython Script Executor.0 - at org.pentaho.python.PythonSession.initSession(PythonSession.java:361) 2016/09/07 06:19:20 - CPython Script Executor.0 - ... 4 more 2016/09/07 06:19:20 - CPython Script Executor.0 - Caused by: java.io.IOException: error=2, No such file or directory 2016/09/07 06:19:20 - CPython Script Executor.0 - at java.lang.UNIXProcess.forkAndExec(Native Method) 2016/09/07 06:19:20 - CPython Script Executor.0 - at java.lang.UNIXProcess.(UNIXProcess.java:248) 2016/09/07 06:19:20 - CPython Script Executor.0 - at java.lang.ProcessImpl.start(ProcessImpl.java:134) 2016/09/07 06:19:20 - CPython Script Executor.0 - at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) 2016/09/07 06:19:20 - CPython Script Executor.0 - ... 6 more

Prussia commented 8 years ago

I guess that it may be caused by the following issue.

/tmp# python pyServer.py Traceback (most recent call last): File "pyServer.py", line 28, in import matplotlib.pyplot as plt File "/opt/conda/lib/python2.7/site-packages/matplotlib/pyplot.py", line 114, in _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup() File "/opt/conda/lib/python2.7/site-packages/matplotlib/backends/init.py", line 32, in pylab_setup globals(),locals(),[backend_name],0) File "/opt/conda/lib/python2.7/site-packages/matplotlib/backends/backend_qt4agg.py", line 18, in from .backend_qt5agg import FigureCanvasQTAggBase as _FigureCanvasQTAggBase File "/opt/conda/lib/python2.7/site-packages/matplotlib/backends/backend_qt5agg.py", line 15, in from .backend_qt5 import QtCore File "/opt/conda/lib/python2.7/site-packages/matplotlib/backends/backend_qt5.py", line 31, in from .qt_compat import QtCore, QtGui, QtWidgets, _getSaveFileName, version File "/opt/conda/lib/python2.7/site-packages/matplotlib/backends/qt_compat.py", line 124, in from PyQt4 import QtCore, QtGui ImportError: libXext.so.6: cannot open shared object file: No such file or directory

Prussia commented 8 years ago

Found a link related http://stackoverflow.com/questions/32389599/anaconda-importerror-libsm-so-6-cannot-open-shared-object-file-no-such-file-o/32389631#32389631

Prussia commented 8 years ago

After installing python-qt4, pyServer.py works fine. But got another issue.

java.lang.NullPointerException at org.pentaho.python.PythonSession.rowsToPythonDataFrame(PythonSession.java:389) at org.pentaho.di.trans.steps.cpythonscriptexecutor.CPythonScriptExecutor.rowsToPyDataFrame(CPythonScriptExecutor.java:458) at org.pentaho.di.trans.steps.cpythonscriptexecutor.CPythonScriptExecutor.processBatch(CPythonScriptExecutor.java:276) at org.pentaho.di.trans.steps.cpythonscriptexecutor.CPythonScriptExecutor.processRow(CPythonScriptExecutor.java:243) at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62) at java.lang.Thread.run(Thread.java:745) 2016/09/08 10:03:07 - CPython Script Executor.0 - ERROR (version 6.1.0.1-196, build 1 from 2016-04-07 12.08.49 by buildguy) : Unexpected error 2016/09/08 10:03:07 - CPython Script Executor.0 - ERROR (version 6.1.0.1-196, build 1 from 2016-04-07 12.08.49 by buildguy) : java.lang.NullPointerException 2016/09/08 10:03:07 - CPython Script Executor.0 - at org.pentaho.python.PythonSession.rowsToPythonDataFrame(PythonSession.java:389) 2016/09/08 10:03:07 - CPython Script Executor.0 - at org.pentaho.di.trans.steps.cpythonscriptexecutor.CPythonScriptExecutor.rowsToPyDataFrame(CPythonScriptExecutor.java:458) 2016/09/08 10:03:07 - CPython Script Executor.0 - at org.pentaho.di.trans.steps.cpythonscriptexecutor.CPythonScriptExecutor.processBatch(CPythonScriptExecutor.java:276) 2016/09/08 10:03:07 - CPython Script Executor.0 - at org.pentaho.di.trans.steps.cpythonscriptexecutor.CPythonScriptExecutor.processRow(CPythonScriptExecutor.java:243) 2016/09/08 10:03:07 - CPython Script Executor.0 - at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62) 2016/09/08 10:03:07 - CPython Script Executor.0 - at java.lang.Thread.run(Thread.java:745)

Prussia commented 8 years ago

New stack trace 2016/09/13 09:15:57 - Pan - Start of run. 2016/09/13 09:15:57 - pyTest2 - Dispatching started for transformation [pyTest2] java.lang.NullPointerException at org.pentaho.python.PythonSession.executeScript(PythonSession.java:479) at org.pentaho.di.trans.steps.cpythonscriptexecutor.CPythonScriptExecutor.executeScript(CPythonScriptExecutor.java:446) at org.pentaho.di.trans.steps.cpythonscriptexecutor.CPythonScriptExecutor.executeScriptAndProcessResult(CPythonScriptExecutor.java:349) at org.pentaho.di.trans.steps.cpythonscriptexecutor.CPythonScriptExecutor.processBatch(CPythonScriptExecutor.java:338) at org.pentaho.di.trans.steps.cpythonscriptexecutor.CPythonScriptExecutor.processRow(CPythonScriptExecutor.java:243) at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62) at java.lang.Thread.run(Thread.java:745) 2016/09/13 09:15:57 - CPython Script Executor.0 - ERROR (version 6.1.0.1-196, build 1 from 2016-04-07 12.08.49 by buildguy) : Unexpected error 2016/09/13 09:15:57 - CPython Script Executor.0 - ERROR (version 6.1.0.1-196, build 1 from 2016-04-07 12.08.49 by buildguy) : java.lang.NullPointerException 2016/09/13 09:15:57 - CPython Script Executor.0 - at org.pentaho.python.PythonSession.executeScript(PythonSession.java:479) 2016/09/13 09:15:57 - CPython Script Executor.0 - at org.pentaho.di.trans.steps.cpythonscriptexecutor.CPythonScriptExecutor.executeScript(CPythonScriptExecutor.java:446) 2016/09/13 09:15:57 - CPython Script Executor.0 - at org.pentaho.di.trans.steps.cpythonscriptexecutor.CPythonScriptExecutor.executeScriptAndProcessResult(CPythonScriptExecutor.java:349) 2016/09/13 09:15:57 - CPython Script Executor.0 - at org.pentaho.di.trans.steps.cpythonscriptexecutor.CPythonScriptExecutor.processBatch(CPythonScriptExecutor.java:338) 2016/09/13 09:15:57 - CPython Script Executor.0 - at org.pentaho.di.trans.steps.cpythonscriptexecutor.CPythonScriptExecutor.processRow(CPythonScriptExecutor.java:243) 2016/09/13 09:15:57 - CPython Script Executor.0 - at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62) 2016/09/13 09:15:57 - CPython Script Executor.0 - at java.lang.Thread.run(Thread.java:745)

Prussia commented 8 years ago

After switching to anaconda 3, the sample works fine. finally.