1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
|
(installation)=
# Installation of gvm-tools
```{note}
The current universally applicable installation process for Python is using
the [pipx] installer tool in conjunction with the [pypi] package repository.
```
## Installing the Latest Stable Release of gvm-tools
For installing the latest stable release of {program}`gvm-tools` from the
[Python Package Index](https://pypi.org/), [pipx], [pip] or [poetry] can be
used.
(using-pipx)=
### Using pipx
You can install the latest release of **gvm-tools** using [pipx].
```shell
python3 -m pipx install gvm-tools
```
On Debian based Distributions like Ubuntu and Kali [pipx] itself can be
installed via
```shell
sudo apt install pipx
```
### Using pip
```{note}
The {command}`pip install` command does no longer work out-of-the-box in newer
distributions like Ubuntu 23.04 or Debian 12 because of [PEP 668](https://peps.python.org/pep-0668).
Please use the {ref}`installation via pipx <using-pipx>` instead.
```
The following command installs {program}`gvm-tools` system wide:
```shell
python3 -m pip install gvm-tools
```
A system wide installation usually requires admin permissions. Therefore,
{program}`gvm-tools` may only be installed for the
[current user](https://docs.python.org/3/library/site.html#site.USER_BASE)
via:
```shell
python3 -m pip install --user gvm-tools
```
For further details and additional installation options, please take a look at
the documentation of [pip].
### Using poetry
To avoid polluting the system and user namespaces with Python packages and to
allow installing different versions of the same package at the same time,
[python virtual environments](https://docs.python.org/3/library/venv.html)
have been introduced.
[poetry] is a tool combining the use of virtual environments and handling
dependencies elegantly.
Please follow the [poetry documentation](https://python-poetry.org/docs/#installation)
to install the tool.
To install {program}`gvm-tools` into a virtual environment, defaulting into
the folder `.venv`, the following command need to be executed:
```shell
poetry install
```
Afterwards, the environment containing the installed {program}`gvm-tools` can be
activated by running:
```shell
poetry shell
```
It is also possible to run single commands within the virtual environment:
```shell
poetry run gvm-cli -h
```
## Getting the Source
The source code of **python-gvm** can be found at
[GitHub](https://github.com/greenbone/python-gvm).
To clone this public repository and install from source for the current user run
the following commands:
```shell
git clone git://github.com/greenbone/gvm-tools.git && cd gvm-tools
python3 -m pip install -e .
```
[pip]: https://pip.pypa.io/en/stable/
[pipx]: https://pypa.github.io/pipx/
[poetry]: https://python-poetry.org/
[pypi]: https://pypi.org/
|