Install Kelvin SDK in Ubuntu 20.04
Requirements
To get started is also very easy. Just ensure you have Docker, Python 3 and Pip 3 installed. Specific installation information on each of these for Windows, Mac and Linux can be found here:
- Docker: Always use the latest version or at least version ≥ 24.0.7 - https://docs.docker.com/engine/install/.
- Python 3: Supported versions from 3.8 to 3.12.
- Pip 3: Included by default with all Python versions starting from 3.4.
Installing
Docker
The Docker CE files in the official Ubuntu 20.04 repository are old and it is strongly recommended you do not use these ones. To start make sure these are not installed on your computer.
sudo apt-get remove docker docker-engine docker.io containerd runc
Now you install docker dependencies:
sudo apt-get install ca-certificates curl gnupg lsb-release
Install the repositories and docker authentication keys;
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
And now install the latest docker version:
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
Python
Normally Ubuntu already has Python 3 installed. You can check this by opening a terminal window and typing:
python3 --version
To use the latest version of Python, we recommend using the deadsnakes PPA to install Python. In this case we will install Python 3.12.
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python3.12-full
And now change the default Python version to 3.12:
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1000
Make sure pip is also installed:
python -m ensurepip --upgrade
Python Virtual Environment
Before installing the Kelvin SDK we strongly recommend you use virtual python environments for your Kelvin SDK so that there are no conflicts, dependency issues or incompatibilities between Kelvin SDK and other python projects you work on.
In the Terminal window let's create a virtual environment and give it a name. In this case we will call it kelvinai.
python3 -m venv kelvinai
Then, you can activate it with this command:
source kelvinai/bin/activate
Kelvin SDK
With all preconditions fulfilled you can now install the Kelvin SDK.
First upgrade pip to the latest version:
pip3 install --upgrade pip
And now install Kelvin SDK:
pip3 install kelvin-sdk
If you get an error that pip3 can not find a version that satisfies kelvin-sdk, make sure you are running a version of Python that is supported by kelvin-sdk.
To check the latest supported Python versions see the kelvin-sdk package details at pypi - https://pypi.org/project/kelvin-sdk/.
And finally check the Kelvin SDK version:
kelvin --version
Congratulations ! You are ready to start using the Kelvin SDK.
Other Related Links
Interesting links related to Kelvin SDK Installation
- Docker Website - https://www.docker.com/
- Python Website - https://www.python.org/
- VirtualEnv Package on Pypi - https://pypi.org/project/virtualenv/
- Kelvin SDK on Pypi - https://pypi.org/project/kelvin-sdk/