Skip to main content
Version: v1.1

Install Python - Linux

Supported operating systems

  • Ubuntu 20.04 LTS
  • Ubuntu 22.04 LTS
  • Ubuntu 24.04 LTS

Other OS versions might work but haven't been tested.

Download Python

Python 3.8+ has to be installed on your system is required. Usually it's present on your linux distribution. If not, refer to the official python documentation.

Install Python

Install Python libraries

Run the following command from the privileged user in a terminal window to install all required system packages:

sudo apt update && sudo apt upgrade -y
sudo apt install -y libnss3-tools ca-certificates
Example output

→ ~ sudo apt install -y libnss3-tools ca-certificates Reading package lists... Done Building dependency tree... Done Reading state information... Done ca-certificates is already the newest version (20240203). The following additional packages will be installed: libnspr4 libnss3 The following NEW packages will be installed: libnspr4 libnss3 libnss3-tools 0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. Need to get 2178 kB of archives. After this operation, 6565 kB of additional disk space will be used. Get:1 http://archive.ubuntu.com/ubuntu noble/main amd64 libnspr4 amd64 2:4.35-1.1build1 [117 kB] Get:2 http://archive.ubuntu.com/ubuntu noble/main amd64 libnss3 amd64 2:3.98-1build1 [1445 kB] Get:3 http://archive.ubuntu.com/ubuntu noble/main amd64 libnss3-tools amd64 2:3.98-1build1 [615 kB] Fetched 2178 kB in 2s (1368 kB/s) locale: Cannot set LC_CTYPE to default locale: No such file or directory locale: Cannot set LC_ALL to default locale: No such file or directory Selecting previously unselected package libnspr4:amd64. (Reading database ... 22557 files and directories currently installed.) Preparing to unpack .../libnspr4_2%3a4.35-1.1build1_amd64.deb ... Unpacking libnspr4:amd64 (2:4.35-1.1build1) ... Selecting previously unselected package libnss3:amd64. Preparing to unpack .../libnss3_2%3a3.98-1build1_amd64.deb ... Unpacking libnss3:amd64 (2:3.98-1build1) ... Selecting previously unselected package libnss3-tools. Preparing to unpack .../libnss3-tools_2%3a3.98-1build1_amd64.deb ... Unpacking libnss3-tools (2:3.98-1build1) ... Setting up libnspr4:amd64 (2:4.35-1.1build1) ... Setting up libnss3:amd64 (2:3.98-1build1) ... Setting up libnss3-tools (2:3.98-1build1) ... Processing triggers for libc-bin (2.39-0ubuntu8.4) ... → ~

Prepare Python environment

Create Python virtual environment

Run below command.

python3 -m venv ~/.aos/venv
Example output

→ ~ python3 -m venv ~/.aos/venv → ~

Verify

Run below command to confirm the installed Python version is 3.8 or later in this virtual environment (venv).

~/.aos/venv/bin/python3 -V