Hi:
Yes, jython is still different from CPython, so Numpy and the like which call out to native C or even fortran code cannot be used from jython.
> might have to go the pythonIoc route
That's definitely a better
idea. Scripts in the display, if used at all, should be limited to simple task, certainly not for number crunching based on numpy/pandas. That's better moved into a service (IOC, pcaspy, ..).
From: Manoussakis, Adamandios <manoussakis1 at llnl.gov>
Sent: Thursday, April 15, 2021 1:59 AM
To: Kasemir, Kay <kasemirk at ornl.gov>; tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: [EXTERNAL] RE: Python Script call from Button press, module not found
Hi Kay,
Thanks for the link, I tried adding to my settings.ini file but still doesn’t seem to be finding the packages I am importing in my script (pandas, numpy).
org.csstudio.display.builder.runtime/python_path=C:\Users\PC\AppData\Local\Programs\Python\Python39\
I did find a fairly old post by you on tech talk and was wondering if this still applied to Phoebus/Jython (seems like jython still doesn’t work with numpy from looking around)
“CSS BOY scripts are executed in jython, not python.
Most of the default python modules are also available in jython, but when you install python modules with binary dependencies like numpy, MySQL_python, .. those are not available in jython.”
If this is the case, it seems like I might have to go the pythonIoc route but I really just wanted to have the script get called when a pv changed value (was using the button to write a value change causing the script to trigger).
Thanks,
Adam
From: Kasemir, Kay <kasemirk at ornl.gov>
Sent: Wednesday, April 14, 2021 10:41 AM
To: tech-talk at aps.anl.gov; Manoussakis, Adamandios <manoussakis1 at llnl.gov>
Subject: Re: Python Script call from Button press, module not found
|