Setting up Python

Check that both pip and at least version 3.6 of Python are installed. QuadlogSCADA and some of the Python modules make use of async/await syntax that earlier versions of Python lack.

Select Python Interpreter

List and check the current versions of Python installed:

$ ls -w40 /usr/bin/python3.*


Select the highest Python version to set as the system default. Set the alternatives as follows and then check.

$ update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1
$ python --version

Python Packages

Install the following Python packages.

$ apt install python3-dev
$ apt install python3-venv
$ apt install python3-pip

Then upgrade pip to ensure it is the latest version.

$ pip3 install -U pip

It might be that some additional Python modules need installing, such as distutils.

$ apt install python3-distutils

Package Management Tool

Poetry is a dependency management tool for Python and it is used to assist in the management of setting up quadlogSCADA source files and its dependencies.

For information and usage on Poetry:

First install ‘curl’ so that Poetry can be downloaded and then self install.

$ apt install curl
$ curl -sSL | python

After Poetry installation is complete, a message will be displayed to set the path for Poetry. This can be done by either re-logging in the user session or by command shown below.

$ source $HOME/.poetry/env

Set Poetry for local virtual environment to exist within the project.

$ poetry config virtualenvs.path /home/quadlog/quadlog-scada --local
$ poetry config true

List the current configuration for Poetry and check that it appears as below.

$ poetry config --list

cache-dir = "/home/quadlog/.cache/pypoetry"
virtualenvs.create = true = true
virtualenvs.path = "{cache-dir}/virtualenvs"  # /home/quadlog/.cache/pypoetry/virtualenvs