Installing and Configuring Python in Linux

Install a supported Python version on a Linux target using Wine for NI TestStand integration.

Use the user account TestStand is deployed on to complete Python setup.
  1. Download the 64-bit Windows Python installer from the Python website, and copy it to the target Linux machine. Refer to Supported Functionality and Configurations on Linux for a list of supported Python versions.
  2. Open a terminal session.
  3. Source the NI TestStand environment.
    source /opt/ni-teststand-2026/constants_and_env.sh
  4. Run the installer with Wine.
    wine "<path>/python-<version>-amd64.exe" PrependPath=1 TargetDir="<path to dir>" 2>/dev/null
    Note Before setting up the Python Installation for Linux target user, verify that the user has read and write access to the target path. Path to Program Files and Program Files (x86) directories are read-only for non-sudo users. If the user lacks the necessary permissions, the sudo user should temporarily grant them access. Once the Python environment setup is complete, revoke the temporarily granted permissions to restore the original access state.

    The Program Files directory with respect to Linux Environment is located at. /home/<target_user>/.niwine10/drive_c/Program Files.

  5. Set up a virtual environment for Linux using Wine.
    1. On the Windows machine, export installed packages from the virtual environment to a requirements file.
      cd path\to\env_name
      .\Scripts\activate
      python -m pip freeze > requirements.txt
      deactivate
    2. Copy requirements.txt to the Linux target machine.
    3. On the Linux target machine, make sure you installed the same Python version with Wine as you used in the Windows virtual environment.
    4. Create a new virtual environment using the Wine-installed Python.
      cd path/to/venv/creation/path
      wine python -m venv env_name 2>/dev/null
    5. Install packages from requirements.txt into the recreated virtual environment. You must have an internet connection to complete this step.
      wine env_name/Scripts/pip.exe install -r requirements.txt 2>/dev/null