Jump to content

Python data function error with GroupBy script

Kiam Ooi

Recommended Posts

I did a test run to see if the python data function works with the example "Groupby" script provided by TIBCO community.

The error message as follows:-

Can anyone know what is the cause

I have using Python engine 3.7.3. Running Spotfire Analyst 10.3.1 LTS HF-003 Buld version

Using Anaconda3


Could not execute function call 'GroupBy'

Problem executing python script: Traceback (most recent call last):

File "C:UsersooikxAppDataLocalTemptmpEC0D.py", line 1, in

from Python_Data_Function import *

File "C:UsersooikxAppDataLocalTempPython_Data_Function.py", line 9, in

import pandas as pd

File "C:UsersooikxAppDataLocalContinuumanaconda3libsite-packagespandas__init__.py", line 19, in

"Missing required dependencies {0}".format(missing_dependencies))

ImportError: Missing required dependencies ['numpy']


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()


Link to comment
Share on other sites

That is strange. I checked my Anaconda Enviroment and it has both numpy (1.16.2) and pandas (0.24.2) installed. Could it be other reason why it is not picking up numpy import both packages in Anaconda Jupyter with no issue.
Link to comment
Share on other sites

From your comment, it looks like the python engine that you are using here is different from the one used by Anaconda and does not have the required packages installed. So to resolve this you can consider either of the two things.

1. In your data function, select the python engine (as shown below) the same as that used by Anaconda.


2. Or Manually install the packages for the Python environment that you are using in the data function.

Link to comment
Share on other sites

The python version is correct (3.7.3). See below at window prompt when type 'python'. It is complaing about activation,  --------------------------------------------------------------------------------------------------------------------------------------------Microsoft Windows [Version 10.0.17134.1425]

© 2018 Microsoft Corporation. All rights reserved.C:Usersooikx>python

Python 3.7.3 (default, Mar 27 2019, 17:13:21) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32Warning:

This Python interpreter is in a conda environment, but the environment has

not been activated.  Libraries may fail to load.  To activate this environment

please see https://conda.io/activationType "help", "copyright", "credits" or "license" for more information.


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