5.1. Installation¶
This tutorial assumes you have Git and Python 3 installed.
5.1.1. Install Prerequisites¶
One of the dependencies (Postgres library Psycopg2) should be built from source.
5.1.1.1. GCC Compiler¶
To install GCC on Debian, open a terminal window and type:
$ sudo apt install build-essential
To check gcc is installed, type:
$ gcc --version
5.1.1.2. Python Header Files¶
To install the Python 3 header files type:
$ sudo apt-get install python3-dev
5.1.2. Clone the Repo¶
First you will need to download wsbackend by cloning its Git repository. Open a terminal window, browse to a folder of your choice and type:
$ git clone https://github.com/websensor/wsbackend.git
The GitHub repository will be cloned to a folder named wsbackend
.
Open this by typing:
$ cd wsbackend
5.1.3. Create a Virtual Environment¶
We will use virtualbox to create a virtual environment. This will isolate our wsbackend installation from the rest of the system.
First install virtualenv:
$ sudo pip3 install virtualenv
Next create a virtual environment named wsbackend_env
:
$ virtualenv wsbackend_env
5.1.4. Activate the Virtual Environment¶
In order for pip
to install dependencies into the virtual enviornment, you must activate it first with:
$ source wsbackend_env/bin/activate
5.1.5. Install Dependencies¶
wsbackend is dependent on a number of Python packages including flask. These are listed in requirements.txt.
To install all requirements, type:
$ pip3 install -r requirements.txt