Installation
Install OpenHTF with pip on Windows, Linux or macOS. Supported Python versions, optional extras for USB and serial plugs, virtual environments, and common install errors.
Last updated · Verified with OpenHTF 1.6.1
OpenHTF is a pure-Python package published on PyPI as openhtf.
Requirements
| Python | 3.10 or newer (OpenHTF 1.6.x). The last release for Python 3.7–3.9 is 1.5.2. |
| OS | Windows, Linux, macOS. Colored console output uses colorama and works on all three. |
| Browser | Any modern browser for the Operator UI; it is served by the test process. |
Install with pip
Use a virtual environment per test station or per project so instrument-library versions stay pinned:
python -m venv .venv
source .venv/bin/activate # Windows PowerShell: .venv\Scripts\Activate.ps1
pip install openhtfCheck the install:
python -c "import openhtf; print(openhtf.__version__)"1.6.1Optional extras
The core package has no hardware dependencies. Extras pull in the libraries the bundled plugs need:
| Extra | Installs | Enables |
|---|---|---|
openhtf[usb-plugs] | libusb1, M2Crypto | openhtf.plugs.usb: ADB and Fastboot over USB (Android DUTs). |
openhtf[serial-collection-plug] | pyserial | openhtf.plugs.generic.serial_collection.SerialCollectionPlug. |
openhtf[examples] | pandas | The upstream measurements.py example (to_dataframe()). |
openhtf[update-units] | xlrd | Only for regenerating units.py from the UNECE spreadsheet; not needed to use units. |
pip install "openhtf[serial-collection-plug]"Your own plugs bring their own libraries: pip install pyvisa pyvisa-py for SCPI instruments, pyserial for serial DUTs, pymodbus for PLCs.
Pin the version
A station should not pick up a new OpenHTF release by accident. Pin it in requirements.txt:
openhtf==1.6.1
pyvisa==1.14.1
pyvisa-py==0.7.2Every page on this site states which release its examples were verified against; Releases lists what changed between versions.
Install from source
To try unreleased fixes from master:
pip install git+https://github.com/google/openhtf.gitCommon install problems
Related
What is OpenHTF?
OpenHTF is Google's open-source Python framework for hardware testing. History since 2016, who maintains it today, who uses it, what it does and does not do.
First Test
Learn how to install OpenHTF and create your first test script with step-by-step instructions to set up a simple test phase and execute it.