Download Python
1. Use the table below to identify a supported version of Python for your version of NI TestStand.
Supported Python Adapters:
NI TestStand Version | Python Versions Supported |
---|
2024 Q4 | 3.8, 3.9, 3.10, 3.11, 3.12 |
2023 Q4 | 3.8, 3.9, 3.10, 3.11 |
2022 Q4 | 3.7, 3.8, 3.9, 3.10 |
2021 SP1 | 3.6, 3.7, 3.8, 3.9, 3.10 |
2. Download the Windows installer for Python.
Install Python
1. Run the Python installer.
2. Make sure you checked the Add python.exe to PATH checkbox. In order for TestStand to find the Python Interpreter, Python will need to be added to
the PATH environment variable.
3. Choose Customize Installation.
4. In the Advanced Options settings:
- Enable Install for all users.
- Install in a location other than “C:\Program Files” or C:\Program Files (86)”, as shown below.
Setting the Python Adapter in TestStand
1. In the Teststand File Menu, go to Configure >> Adapters… >> Python >> Configure…
2. Choose the Python version you installed.
3. You might want to check Display console for interpreter sessions.
Attention: If you do check Display console for interpreter sessions, during adapter calls a console window is opened, and print() commands will be shown. It is generally suggested not to check this checkbox for deployment, as then you would need to manually handle the console popups. Please also keep in mind not to close the console windows manually - the python adapter will crash if you do, and you will need to Unload all modules before you can use Python Adapters again.
4. You might want to use a Virtual Environment using virtualenv. See KB Article TestStand's Python Adapter Configuration Shows Invalid Virtual Environment Path for more information.
For more information on the Python Adapter Configuration see NI TestStand Help >> Python Adapter.
Done.
You are done installing Python for NI TestStand. You will find Python examples for TestStand steps in the Related Links section below.