Jump to content
We've recently updated our Privacy Statement, available here. ×

Alert When Running Python Data Functions (PyDf)


Michael Wang 5

Recommended Posts

I have Python Data functions successfully deployed and Ive written a very simple script to test its functionality. When I try to execute the data function, I am greeted by an alert that says the following:

 

Could not execute function call.

File not found: C:UsersusernameAppDataLocalTemptmpD6D6.stdf

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

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

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

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

 

Any idea why this is Thank you!

Link to comment
Share on other sites

Hi Andreas -

I appreciate your reply. I've tried the example files as well and I get the same error. I've realized the issue has to do with how (where) I installed pandas and numpy. Per the manual, it states that:

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

I've already added my runtime Python distribution to my PATH environment variable such that within Spotfire, it recognizes my Python version. How do I install numpy, pandas, and other packages in my Python environment

I always have a lot of trouble getting the ball rolling and getting all the paths/environments set up correctly. Any help would be tremendously appreciated. Thank you.

Link to comment
Share on other sites

Hi Andreas -

I got all packages installed. It seems the issue had been a descrepancy in the version number of the packages corresponding to the version of Python.

 

I no longer get that error message when executing the sample data functions. Instead, the error I receive now reads:

Could not execute function call.

Failed to create DataTable

Failed to create DataTable

at Spotfire.Dxp.Data.ColumnFactory.CreateColumns(DataRowReader reader, String documentTitle, IDataPropertyContainer properties, GlobalMethodRegistry globalMethodRegistry, CxxSession session, Boolean addNewProperties, PartialDataLoadReport report, Func`2 resultPropertiesCreator, UInt64 maxRowsToConsume, Boolean& allDataRead)

at Spotfire.Dxp.Data.ColumnFactory.CreateColumns(DataRowReader reader, String documentTitle, IDataPropertyContainer properties, DataPropertyRegistry propertyRegistry, GlobalMethodRegistry globalMethodRegistry, CxxSession session, Boolean addNewProperties, PartialDataLoadReport report, ResultProperties resultProperties)

at Spotfire.Dxp.Data.DataFunctions.DataFunctionImpl.DataFunctionWorkItemState.Convert(DataRowReader reader, DataManager dataManager, Boolean mangleNames)

 

Any idea what is causing the dataframes not to be generated Thank you.

Link to comment
Share on other sites

  • 5 months later...

Hi,I am going through the exact same issues but cannot solve them. My packages are all installed and working correctly e.g. in spyder but still I get the File not found errorCould not execute function call 'Python Script DataFunction'

File not found: C:UsersHER1DRAppDataLocalTemptmpF.stdfwhen running this simple script tryting to return moons as a data table:

import sklearn.datasets as datamoons, _ = data.make_moons(n_samples=50, noise=0.05)

As soon as I remove moons from the output variables list the script runs fine but obviously returns no data.Any ideas what could be the issueThanks,

Mark

Link to comment
Share on other sites

  • 1 year later...
  • 1 month later...

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...