Python Has Failed To Initialize Using DIAdem

Updated Nov 26, 2021

Reported In

Other

  • DIAdem 2020
  • Python

Issue Details

I want to use Python with DIAdem 2020 via the Python installation directory provided in DIAdem 2020. When I try to run the script, I get the following errors:

Initializing Python has failed


 
Error: Python is not initialized.

Solution

  1. Make sure the Python bitness matches the DIAdem bitness. DIAdem 2019 and above are available in 64-bit only.
  2. Use at least Python version 3.7.xxx. Kindly refer to the readme of the DIAdem version you are using to verify which Python version it supports.
  3. Make sure the Path in environment variable for Python is included.
  • If you want Python to work across multiple users, check that the Python directory is added to PATH in both User Variables and System Variables.
  • Manually add/copy the path if required.
  1. Ensure PYwin32 library has been installed on the Python version you are planning to use with DIAdem.
  2. Run DIAdem as Administrator.
  3. Add the directory location of the Python engine to DIAdem Settings:
    1. In DIAdem, navigate to Settings >> DIAdem Settings.
  1. Click on SCRIPT under the Panels section. 
  2. Select Python as the Script language
  3. If installing different version of python, input the directory location pointing to the Python engine as the Python Installation Path. For example, the path to the standard python engine that ships with SystemLink would be: C:\Program Files\National Instruments\Shared\Skyline\Python\3.7\ *If you use the default Python version, leave the Python Installation path blank.

  1. Click OK.
 
  1. Restart DIAdem to have the Python configuration in DIAdem Setting take effect.
  2. DIAdem will now be able to run Python script without showing any error.
 
 

Additional Information

DIAdem 2020 does not support virtual Python environments. Only real Python engines install to dedicated directories registered with the OS.