Solution
The error occurs due to compatibility issues between the module and the installed Python version. Some parts of this module are only compatible with Python 3.9 and above, so in order to use the module, you will need to use Python version 3.9 or above. To solve the issue, follow the steps below:
Note: Before proceeding, ensure that the Python version you want to use is compatible with the DIAdem installed on your computer.
- Open the Command Prompt and run py -0 to check the installed Python versions. If Python 3.9 or above is not listed, proceed to install it.

- Follow these steps to add the installed Python path:
- Open Settings.
- Go to System.
- Navigate to About and click on Advanced system settings.
- In the Advanced tab, click on Environment Variables.

-
- Under User variables, select Path and click Edit.

-
- Click New and enter C:\Users\<user>\AppData\Local\Programs\Python\<python version> and C:\Users\<user>\AppData\Local\Programs\Python\<python version>\Scripts. Move these paths to the top of the list.

- Restart the Command Prompt and run python --version to verify the default Python version.

- Install tdm_loader. This module will be installed in the default Python version file path. Additionally, you may need to reinstall the PyWin32 module to use Python in DIAdem.
- Execute the following commands one by one to ensure tdm_loader can be used without issues:
-
- cd c:\Windows\System32
- python
- import tdm_loader
- help(tdm_loader)
- If the commands execute without errors as above picture, open DIAdem and change the Python Installation Path in the DIAdem script settings to C:\Users\<user>\AppData\Local\Programs\Python\<python version>. This will change the default version of Python used by DIAdem.
- Then, run import tdm_loader in the Python script in DIAdem to verify that the module can be used correctly.