Jump to content

PyDf - Python Data Function Spotfire Analyst 10.3 Setup and Question


Steven Hui

Recommended Posts

To clarify, does the server only need the .spks from the list of pre-requisites below Does the distribution and packages listed in 3-6 refers to the client side

Prerequisites

The following requirements must be met to enable running Python code from the data function extension:

 

Spotfire 7.13 (or 7.14) client and server

Latest copy of

 

SpotfirePS.DataFunctions.Python*.spk

SpotfirePS.DataFunctions.PythonForms.*.spk

 

 

A runtime python distribution (Preferred versions are 2.7.xx and 3.7.xx) installed in your local environment and the python executable file path listed in your PATH environment variable. By doing this, the Spotfire can automatically detect your python version and make use of the provided boilerplate python code.

The packages used in the python code must be manually installed in your Python environment before calling it in the user code.

The following packages Pandas, Numpy must be installed for the Python data function to work. Preferred Pandas version is Pandas 0.24.0 and above

Other preferred Data Science packages are Scipy, Matplotlib, Scikit-learn, NLTK.

 

 

 

 

Thus far, I have only uploaded the .spks onto our Spotfire. I believe our end user has all the necessary python packages and distributions on his local machine. However, when he tries to run a simple 2+2 function, he gets the following error. Any assistance is appreciated!

 

Could not execute function call 'test'

 

File not found: C:UserskpresleyAppDataLocalTemptmpA134.stdf

 

at Spotfire.Dxp.Data.Import.FileDataSource..ctor(String filePath, String[] additionalFilePaths)

at SpotfirePS.DataFunctions.Python.PythonDataFunctionExcecutor.d__4.MoveNext()

at Spotfire.Dxp.Application.Extension.CustomDataFunctionExecutor.d__5.MoveNext()

at Spotfire.Dxp.Data.DataFunctions.DataFunctionExecutorService.d__3.MoveNext()

Link to comment
Share on other sites

Hi shui,

 

What I remember from this Spotfire version, is that I had to install the Python packages on the webplayers as well (pip install command). Same is true for the Python distribution software. And there was something special with it, during installation time. I think it had to do with adding Python the the PATH variable (not checked by default in the installation).

 

Nonetheless, if the user is using the local Python engine, she/he should be able tolocally run a Python based data function. To check this, please have the user verify the settings for Data Functions in the Options window (menu Tools --> options and then scroll to the bottom).

 

kind regards,

 

David

Link to comment
Share on other sites

Thanks for your suggestions, David.

 

I'm able to reproduce the errors on my machine too, by trying to use a local Python engine instead of installing onto the WebPlayers, but I can give that a shot. 

 

I've tried installing both the 3.9 and 3.7 Python ditstributions, and updating pandas through pip. I made sure to install the PATH variables for the python distributions as well, and can verify that they appear in my user/system environment variables correctly. However, when i try to run a simpel y=2*x script, I encounter the same 'File Not Found' error as before. Hmmm...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...