Skip to content

Kalliope requirements for Ubuntu

Pre requisite

Ubuntu 18.04

Install some required system libraries and software:

sudo apt update
sudo apt install -y \
    git python3-dev python3.7-dev libsmpeg0 libttspico-utils flac \
    libffi-dev libssl-dev portaudio19-dev build-essential \
    libatlas3-base mplayer wget vim sudo locales alsa-base alsa-utils \
    pulseaudio-utils libasound2-plugins python3-pyaudio libasound-dev \
    libportaudio2 libportaudiocpp0 ffmpeg 

Ubuntu 20.04

Install some required system libraries and software:

sudo apt update
sudo apt install -y \
    git python3-dev libsmpeg0 libttspico-utils flac \
    libffi-dev libssl-dev portaudio19-dev build-essential \
    libatlas3-base mplayer wget vim sudo locales alsa-base alsa-utils \
    pulseaudio-utils libasound2-plugins python3-pyaudio libasound-dev \
    libportaudio2 libportaudiocpp0 ffmpeg 

Install lasted version of the python package manager

Install the last release of python-pip

wget https://bootstrap.pypa.io/get-pip.py
sudo python3 get-pip.py

Kalliope installation

Note: Python 2 is not supported anymore

Method 1 - User install using the PIP package

You can install kalliope on your system by using Pypi:

sudo pip3 install kalliope

Method 2 - Manual setup using sources

Clone the project:

git clone https://github.com/kalliope-project/kalliope.git
cd kalliope

Install the project:

sudo python3 setup.py install

Method 3 - Developer install using Virtualenv

Install the python-virtualenv package:

sudo pip3 install virtualenv

Clone the project:

git clone https://github.com/kalliope-project/kalliope.git
cd kalliope

Generate a local python3 virtual environment:

virtualenv venv -p /usr/bin/python3

Activate the local environment:

source venv/bin/activate

Install Kalliope

python3 setup.py install

Method 4 - Developer, dependencies install only

Clone the project:

git clone https://github.com/kalliope-project/kalliope.git
cd kalliope

Install the python dependencies directly:

sudo pip3 install -r install/files/python_requirements.txt

Test your env

Check your microphone and speaker config

To ensure that you can record your voice, run the following command to capture audio input from your microphone:

rec test.wav

Press CTRL-C after capturing a sample of your voice.

Then play the recorded audio file

mplayer test.wav

Your installation is now complete, let's take a look now to the getting started documentation to learn how to use Kalliope.

(Optional) Start Kalliope automatically after a reboot

If you want to start Kalliope automatically:

Place the script bellow in /etc/systemd/system/kalliope.service.

Update the path <my_config_path> with the path where you've placed your brain.yml and settings.yml.

Update the <username> with a non root user. For example, on Raspbian you can set pi.

[Unit]
Description=Kalliope
After=pulseaudio.service

[Service]
WorkingDirectory=<my_config_path>

Environment='STDOUT=/var/log/kalliope.log'
Environment='STDERR=/var/log/kalliope.err.log'
ExecStart=/bin/bash -c "/usr/local/bin/kalliope start > ${STDOUT} 2> ${STDERR}"
User=<username>

[Install]
WantedBy=multi-user.target

E.g

[Unit]
Description=Kalliope
After=pulseaudio.service

[Service]
WorkingDirectory=/home/pi/my_kalliope_config

Environment='STDOUT=/var/log/kalliope.log'
Environment='STDERR=/var/log/kalliope.err.log'
ExecStart=/bin/bash -c "/usr/local/bin/kalliope start > ${STDOUT} 2> ${STDERR}"
User=pi

[Install]
WantedBy=multi-user.target

Create both log files and give rights to you user

sudo touch /var/log/kalliope.log
sudo touch /var/log/kalliope.err.log
sudo chown pi:pi /var/log/kalliope*

Then, reload systemctl, start the service and enable it at startup

sudo systemctl daemon-reload
sudo systemctl start kalliope
sudo systemctl enable kalliope

Check that the service is ok

sudo systemctl status kalliope