REVEN Python API installation guide
Prerequisites
The supported platforms for installing the REVEN Python API are Debian 10 Buster 64 bits and Windows 10 64 bits. A working 3.7 (CPython) installation is also required.
Note for Debian: other dependencies will be installed over the course of this document and can be found in the
dependencies.sh
file.
Python 2 / Python 3
Since Python 2 reached its end-of-life in January 2020, we only provide a Python 3 version of the API.
Via Jupyter Notebook
REVEN provides integration with Jupyter Notebook, which allows you to use the REVEN Python API from your browser. For more information on this method of using the API, please refer to the dedicated documentation page.
On the REVEN server
If your Python development environment is on the same machine as your REVEN server, then the Python API is already
installed, and you just need to activate it.
Go to the install path of your REVEN package, then execute the following in a bash shell:
source sourceme_python3
This results in activating a virtualenv with the Python API installed. To
deactivate it and get back to your original Python environment, either open a new shell, or run the deactivate
command in the current shell where the virtualenv was activated.
Note that the sourceme_python3
file is a bash script and may not work as intended when
sourced from different shells (fish
, zsh
...).
On a client workstation
To install on a client workstation, you will need to download the corresponding archive from the Download
page of the Project Manager.
Choose the package corresponding to the desired OS and Python version.
This section assumes that you are working from the root directory of the decompressed archive.
Virtualenv / user-wide / system-wide
Python development provides many ways of installing a Python package. This document covers the main installation options.
-
Using a virtualenv: A local installation that won't conflict with any other Python environment in your system. This is the most recommended way to make Python development, since it will guarantee that you won't break any existing Python script by accidentally upgrading a common dependency.
On Debian 10 Buster, we provide asourceme
bash script that automatically creates a virtualenv containing the REVEN Python API for you. For a virtualenv installation under Windows, you will first need to activate a virtualenv and then usepip
normally during the next section. -
A user-wide installation: This installation does not conflict with other users on the system, but you may have to manually setup the environment for your Python packages to be found.
For a user-wide installation, you'll need to usepip
with a--user
option after theinstall
argument during the next section. -
A system-wide installation: This installation may conflict with other users or applications on the system, and requires root privileges. But after a system-wide installation, any user on the system will be able to use the REVEN Python API.
For a system-wide installation, you will need to usepip
withroot
privilege on Debian Buster (sudo
for example), and normally on Windows during the next section.
Windows
First, be sure to have a 64-bit 3.7 installation available with the pip
utility installed. The default Python
installer typically provides this component.
NOTE: the REVEN python API is not compatible with a 32-bit python environment.
- Step 1 (optional): create the virtualenv
The following Powershell lines will provide you with a virtualenv namedenv
in your current working directory.
python.exe -m pip install virtualenv # Not required if you already have virtualenv installed
python.exe -m virtualenv --system-site-packages env
env\Scripts\activate
- Step 2 (required): upgrade the
pip
utility:
python.exe -m pip install --upgrade pip
- Step 3 (required): install the REVEN API
Paths are given relative to this current folder.
python.exe -m pip install (Get-Item dependencies\*.whl).FullName
python.exe -m pip install (Get-Item reven_api*.whl).FullName
python.exe -m pip install (Get-Item reven2*.whl).FullName
Debian 10 Buster
For a Debian 10 Buster client, the recommended way to use the Python API is to simply source the sourceme
file
contained in the downloaded archive:
- Step 1 (required): install the system dependencies
Paths are given relative to this current folder.
sudo ./dependencies.sh
- Step 2: source the
sourceme
file
source sourceme
This will leave in a virtual environment where reven2
can be imported:
python -c "import reven2"
Note that the sourceme
file is a bash script and may not work as intended when
sourced from different shells (fish
, zsh
...).
Debian 10 Buster, manual installation
If you prefer installing in your own virtualenv, or as user or system-wide, follow the instructions below.
First, be sure to have a Python installation available with the corresponding pip
utility installed.
- Step 1 (required): install the system dependencies Paths are given relative to this current folder.
sudo ./dependencies.sh
- Step 2 (optional): create the virtualenv
sudo apt install python3-venv # If venv is not already installed
python3 -m venv --system-site-packages env
source env/bin/activate
- Step 3 (required): upgrade the
pip
utility
python -m pip install --upgrade pip
- Step 4 (required): install the REVEN API
Paths are given relative to this current folder.
python -m pip install dependencies/*.whl
python -m pip install reven_api*.whl
python -m pip install reven2*.whl
Next steps
If you successfully completed the previous steps, you should have a working REVEN Python API. Feel free to check out the Quickstart guide for a smooth kick-off.