Error Importing Python Module in NI DIAdem SCRIPT

Updated Jan 27, 2025

Reported In

Software

  • DIAdem 2020

Programming Language

  • Python

Issue Details

When I try running the Python code created in NI DIAdem SCRIPT, I receive the following error and cannot run the code: 

Error occurred when running the Python script: 

Traceback (most recent call last): File "C:\Users\xxx\Desktop\xxx.py", line 15, in <module> ModuleNotFoundError: No module named 'numpy'

Solution

There are several possible reasons why the module cannot be found. 

Please try the following troubleshooting steps: 

  • Make sure the Python bitness matches the NI DIAdem bitness. NI DIAdem 2020 is only available in 64-bit.
  • Use a Python version 3.7.xxx as NI DIAdem supports Python up to version 3.7.
  • Make sure the Path in environment variable for Python is included.
  • Specify the Python installation path in the NI DIAdem configuration for SCRIPT (Menu >> Settings >> DIAdem Settings >> SCRIPT).
  • Using the command prompt, check where Python is installed on the PC by typing where python in the appropriate directory.
    • If command returns the following filepath, you made need to disable the app execution aliases for Python in the Windows Apps & features settings
<C:\Users\xxx\AppData\Local\Microsoft\WindowsApps>