Installing and Configuring Python in Linux
- Aktualisiert2026-07-27
- 2 Minute(n) Lesezeit
Installing and Configuring Python in Linux
Install a supported Python version on a Linux target using Wine for NI TestStand integration.
- 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.
- Open a terminal session.
-
Source the NI TestStand environment.
source /opt/ni-teststand-2026/constants_and_env.sh
-
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.
-
Set up a virtual environment for Linux using Wine.
-
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
- Copy requirements.txt to the Linux target machine.
- On the Linux target machine, make sure you installed the same Python version with Wine as you used in the Windows virtual environment.
-
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
-
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
-
On the Windows machine, export installed packages from the virtual environment to a requirements file.
Verwandte Inhalte
- Python Installer
- Supported Functionality and Configurations on Linux
Linux deployment includes support for the following functionality and configurations.