Python Module Not Found Error in SystemLink Analysis Automation

Updated Apr 30, 2024

Reported In

Software

  • SystemLink Server
  • SystemLink TDM Analysis Add-On

Issue Details

  • I have created an Analysis Automation Procedure (.ANP file) in DIAdem that imports external Python modules. The script runs fine in DIAdem, but when I execute the ANP from SystemLink, I receive a System error stating ModuleNotFoundError.
  • My SystemLink Analysis Server shows the below error when I execute an ANP using Python code.

An error has occurred while executing a Python script: Traceback (most recent call last): <traceback calls>, in On_Run_AnalysisProcedure from <module name> import <function> ModuleNotFoundHere: No module named '<module name>'

ANP Module Not Found Error.PNG

Solution

This error occurs in an Analysis Automation Procedure (.ANP file) when the SystemLink Server does not have the necessary Python module installed.
Follow the steps below to resolve this error:
 
  1. From the SystemLink Web App, open Utilities >> Jupyter.
    • If Jupyter does not appear as an option, ensure that the NI SystemLink Server - JupyterHub Module is installed in NI Package Manager, and all services in the NI SystemLink Server Configuration application are running.
  2. Create a new Jupyter Notebook by clicking File >> New >> Notebook.
    • Ensure that the selected kernel is Python 3.
  3. In a code cell, enter !pip install <module> where <module> is the name of the missing module as reported in the error.
  4. Run the notebook.
    • The image below is an example of installing the [External] fpdf module in SystemLink.
Install fpdf Jupyter.PNG
  1. Re-run the Analysis Automation Procedure in SystemLink.