ModuleNotFoundError when creating Python data function in Spotfire

ModuleNotFoundError when creating Python data function in Spotfire

book

Article ID: KB0070504

calendar_today

Updated On:

Products Versions
Spotfire Analyst 10.10 and higher
Spotfire Desktop 10.10 and higher

Description

When executing a Python Data Function in Spotfire, it may fail with the following error:
 
Could not execute function call
Error executing Python script:

ModuleNotFoundError: No module named '<packagename>'

Issue/Introduction

When creating a Python data function in Spotfire which uses different package(s), the ModuleNotFoundError: No module named '' error may be returned.

Resolution

There are a couple of situations that could trigger this error:
  • If you are trying to import Spotfire modules like Spotfire.Dxp.Application or Spotfire.Dxp.Data or any others modules in Python Data Function then you will see this error. These Spotfire modules are to be used in IronPython scripts which can help to extend Spotfire, but are not available in Python Data Functions. 
  • If the package(s) used in the data function are not seen in the list of Installed Packaged under the Package Management. To use these package(s) in the Python Data Functions, search for the package in the Package Management, select the required one, and click Install.

Additional Information

Doc: Python Tools – Details on Package Management