<!-- HILSTER htf 4.3.1 -->
**htf 4.3.1** · [HTML](../installation.html) · [Complete PDF manual](../_downloads/htf-4.3.1.pdf)

<a id="installation"></a>

# Installation, Activation and Upgrading

<a id="installation-requirements"></a>

## Requirements

To install `htf`, [Python 3.12](https://www.python.org/downloads/) or newer is required.

`htf` is tested on Microsoft Windows and all Linux versions that support
[manylinux wheels](https://github.com/pypa/manylinux). It also runs on `Raspberry Pi` computers.

Wheels for Python 3 on Linux are shipped using recent `manylinux` and `abi3` formats for `Python 3.12` and newer
for 64-bit machines only.

We host our own [pypi server](https://pypi.hilster.io/).

For further information regarding the support of your specific project requirements,
please contact our [Support](support.md#support).

## Installation on Windows

If Python is not already installed, please download and install Python using the
[official CPython installers](http://www.python.org/download/) or use a
CPython distribution of your choice, e.g. [WinPython](https://winpython.github.io/).

It is recommended to install Python in the typical paths, e.g. `C:\Python312\` for Python 3.12 respectively.

If you want to install `htf` via `pip`, you need to add the
`Scripts` folder of the Python distribution to your
`%PATH%` environment variable (there is an option in the installer).
`pip` is shipped with recent Python Windows distributions.

## Installation on Linux

On most Linux distributions, at least one version of Python should be installed by default.
Since 2020, this version should be Python 3.

`pip` can be installed by installing the packages `python3-pip` for Python 3.12, respectively.
There are no other dependencies that need to be installed on Linux.

On Ubuntu for example, all dependencies should be satisfied using:

```bash
sudo apt install python3-pip
```

## Installation on Raspberry Pi OS

You can easily install HILSTER Testing Framework on a Raspberry Pi OS using the 64 bit installation image
available at [downloads page](https://downloads.raspberrypi.org/raspios_arm64/images/).

## Virtual environments with Virtualenvwrapper

It is generally recommended to separate project dependencies into different virtual environments.

More information about setting up and using virtual environments on Linux can be found in the [python-guide](http://docs.python-guide.org/en/latest/dev/virtualenvs/)
and for Windows in the [virtualenv docs](https://virtualenv.pypa.io/en/latest/).

It is recommended to use the `virtualenvwrapper` package, which provides functions that allow for a
convenient handling of virtual environments.
Further information can be found in the [virtualenwrapper docs](https://virtualenvwrapper.readthedocs.io/en/latest/).

There is also a Windows port called [virtualenvwrapper-win](https://github.com/davidmarble/virtualenvwrapper-win/).

## Virtual environments with uv

[uv](https://docs.astral.sh/uv/) supports virtual environments, too.

To create a virtual environment, run:

```bash
uv venv <virtual-environment-name>
```

To activate the virtual environment, follow the activation instructions.

## Installation using Anaconda

Alternatively [Anaconda](https://www.anaconda.com/) can be used as a multi-platform Python-Platform.
Installers for Windows and Linux are provided by Anaconda.
It is pre-packaged with multiple libraries especially from the data science community.
Before moving on please download and install Anaconda on your system.

After the base install it is again recommended to separate project dependencies into different
virtual environments.
You can create a `conda` environment using the Anaconda Prompt:

```bash
conda create --name environment_name python
conda activate environment_name
```

Further references to the Anaconda Prompt can be found in the
[Anaconda docs](https://conda.io/projects/conda/en/latest/).

You can then proceed to install `htf` via `pip`.

## Installation of htf via pip

Given that Python is properly set up and the virtual environment of your choice is activated,
you can simply install `htf` using pip:

```bash
pip install --index-url https://hilster.io 'htf[full]'
```

To install the community version, run:

```bash
pip install --index-url https://hilster.io htf-community
```

Herein, `--index-url https://hilster.io` adds the HILSTER Python package repository
to the search index of pip so that the HILSTER packages can be discovered.

Depending on your installation, you might have to replace `pip` with `pip3`.

## Installation of htf via uv

`htf` can also be installed using [uv](https://docs.astral.sh/uv/).

To install `htf`, run:

```bash
uv pip install --index-url https://hilster.io 'htf[full]'
```

To install the community version, run:

```bash
uv pip install --index-url https://hilster.io htf-community
```

Herein, `--index-url https://hilster.io` adds the `HILSTER Python package repository`
to the search index so that the HILSTER packages can be discovered.

<a id="installation-options"></a>

## Installation options

`htf` comes with submodules that can be installed manually or using installation options.

Installation options are put behind the package in the `pip` prompt.

For example

```bash
pip install -i https://pypi.hilster.io htf
```

only installs the core of `htf`.

```bash
pip install -i https://pypi.hilster.io htf[full]
```

installs all possible options.

There is an installation option for all submodules, e.g. the option for `htf-modbus` is `[modbus]` and for
`htf-hart` you can use `[hart]`.

Installation options can be combined as a coma-separated list:

```bash
pip install -i https://pypi.hilster.io htf[modbus,hart]
```

installs `htf-modbus` and `htf-hart`.

Another option is `htf[oser]` to install `oser` directly.

## Installation behind a corporate proxy

If you are behind a corporate proxy, there are several ways to tell `pip` about the proxy url and
your credentials.

The simplest solution is to just use the `--proxy` argument

```bash
pip install -i https://pypi.hilster.io --proxy=http://<username>:<password>@<host>:<port> htf
```

If you want to persist the `proxy` settings, it is recommended to store them in the pip configuration
file `pip.ini`, which is stored in the `pip` folder in your home directory.

```ini
[global]
proxy = http://<username>:<password>@<host>:<port>
```

Another solution is use the environment variable `https_proxy`.

On Linux enter:

```bash
export https_proxy=https://<username>:<password>@<host>:<port>
```

and on Windows enter:

```bat
set https_proxy=https://<username>:<password>@<host>:<port>
```

and continue with the installation without the `--proxy` option.

## Activation

HILSTER’s license server is used for remote activation.

Activation is not needed if you use the community edition, since a license is already included.

To activate non-community versions of the software, you need one or more activation keys that HILSTER sent you.

An activation key consists of `16` upper case letters in `4` groups
concatenated by dashes.

```bash
hlm activate ABCD-EFGH-IJKL-MNOP
```

You can also activate more then one activation key at a time.

```bash
hlm activate ABCD-EFGH-IJKL-MNOP QRST-UVWX-YZAB-CDEF  # ...
```

Activation creates a license that is stored locally.

To renew the licenses once activated, simply run

```bash
hlm renew
```

When you are behind a proxy, you have to set the environment variable
`https_proxy` like in the installation process.

Every virtual environment has to be activated separately.

## Check installation

To list your licenses, run

```bash
hlm list
```

If htf prints a version, it is unlockable

```bash
htf version  # prints the version
```

## Upgrading

To upgrade add the `-U` option:

```bash
pip install -i https://pypi.hilster.io -U htf
```

If you are using a proxy you must add the `--proxy` option or set environment variables like described above.

## Installing a specific version

To install a specific version use

```bash
pip install -i https://pypi.hilster.io htf==2.0.0
```

for example.

If you are using a proxy you must add the `--proxy` option or set environment variables like described
above.

<a id="automatic-update-check"></a>

## Automatic check for updates

`htf` checks for available updates at the end of a test run automatically.
This can be disabled by setting the `HTF_DISABLE_UPDATE_CHECK` environment variable.

On Linux enter:

```bash
export HTF_DISABLE_UPDATE_CHECK=1
```

and on Windows enter:

```bat
set HTF_DISABLE_UPDATE_CHECK=1
```

<a id="htf-community"></a>

## Installing the community version

To install the [community version](editions.md#community-edition), run

```bash
pip install -i https://pypi.hilster.io htf-community
```

Manual activation is not needed because the community license is already included and
the activation will be performed automatically.

Make sure to use a recent Python version to install the latest version for `htf-community`.
Read [installation requirements](#installation-requirements) for more information.

The available wheels and supported Python versions can also be found on
[HILSTER’s PyPI server](https://pypi.hilster.io/simple/htf-community/), too.
