On debian and derivatives, the python3 package only installs Python up to version 3.7, which doesn't include support for the typings used in this project
It might therefore be necessary to manually compile Python 3.9.5
-
Run the following command to setup the build tools
sudo apt install wget software-properties-common build-essential libnss3-dev zlib1g-dev libgdbm-dev libncurses5-dev libssl-dev libffi-dev libreadline-dev libsqlite3-dev libbz2-dev
-
Download Python 3.9.5
wget https://www.python.org/ftp/python/3.9.5/Python-3.9.5.tgz
-
Extract the contents of the compressed file, and move into the folder
tar xvf Python-3.9.5.tgz cd Python-3.9.5/
-
Configure
./configure --prefix=/usr/local --enable-ipv6 --enable-loadable-sqlite-extensions --enable-optimizations --enable-shared
-
Install
sudo make altinstall
-
Verify with the following command
python3.9 -V
Additionally, you might want to remove any old references to python3, and alias this to the new installation
sudo apt remove python3
Once this is complete, add the following line to the end of ~/.bashrc
alias python3='python3.9'
If Python complains that it's library module can not be found, run the following command
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
sudo apt install python-pip python3-venv