TestStand's Python Adapter Configuration Shows Invalid Virtual Environment Path

Updated Dec 11, 2023

Issue Details

I would like to use my Python script in TestStand but when I am configuring TestStand's Python adapter, it shows the following warning:
Invalid virtual environment path. TestStand supports virtual environment created using 'virtualenv' tool. Make sure virtual environment directory can be found using TestStand search directory.

Solution

To use Python script in TestStand, kindly ensure the Python script is in a virtual environment directory. Instructions below demonstrate an example on how to create a virtual environment directory for add.py Python script located in Desktop's PyTs folder.
  1. Open Command Prompt and install virtualenv package by using the following command 
    pip install virtualenv
  2. Change command prompt directory to Desktop since PyTs folder is located at Desktop
  3. Create virtual environment for PyTs folder by using the following code
    virtualenv PyTs
  4. Once the virtual environment creation is done, reconfigure Python adapter by pointing Python virtual environment to the PyTs folder.
Python script can now be used in TestStand without invalid virtual environment path error

Additional Information

If Directory PyTs Not Found pop-out window shows up after perform Step 4 above, user is encouraged to select Add the directory that contains the directory you selected to the list of search directories. This is to ensure TestStand able to locate the folder without any issue.


TestStand only supports Virtual Environments created with the virtualenv tool. For more information on Python Adapter configuration see this documentation link.