pentaho-labs / pentaho-cpython-plugin

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

Error in CPython Script Executor step #32

Open ArlinaMascarenhas opened 3 years ago

ArlinaMascarenhas commented 3 years ago

I have written a simple python code that works just fine in the Jupiter notebook. The Environment Variable path is set: image But when I try executing the code in the CPython Script Executor step, getting errors as follow: image

Do I need to set the path variable explicitly for PDI? If yes, where/how?

Thanks!

ainsua77 commented 3 years ago

Hi Arlina, I've the same issue, can you solved?

ArlinaMascarenhas commented 3 years ago

Hi, No, not yet :(...Please let me know if you can find any solution.

On Tue, 16 Mar, 2021, 5:58 pm ainsua77, @.***> wrote:

Hi Arlina, I've the same issue, can you solved?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pentaho-labs/pentaho-cpython-plugin/issues/32#issuecomment-800217332, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKFKV33EGUSEXQJHYG42ILTTD5FIHANCNFSM4Y7XUHDQ .

kiedanski commented 3 years ago

In linux, it only works if you symlink the system's python to the one you are trying to use

eicherjc commented 3 years ago

If you're on Windows, immediately below the set OPT= line in spoon.bat, put a line like set PATH=c:\path\to\your\preferred\python;%PATH%

If you're on Linux, immediately below the OPT= line in spoon.sh, put a line like export PATH=/path/to/your/preferred/python:$PATH

This will make Spoon find the right python first rather than the default system one.

CarlosRumir commented 3 years ago

In Windows, using anaconda it create its own environment that you can access from its terminal. Once you add it to the common windows Path you must activate this environment. I think that's the only step is missing.

https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#activating-an-environment

In order to check if everything its ok you should be able to write 'pip' or 'conda' in your cmd and get a good response.

Hope this helps someone here. Right now i'm using Cpython Script Executor on Pentahoo 8.2, Windows 10.

Trompettesib commented 2 months ago

The solution for me was to install all the library listed in the error message (numpy matplotlib scikit-learn pandas scipy). I just ran

pip install numpy matplotlib scikit-learn pandas scipy