Install Python 3.8.3 on Raspberry Pi
In this tutorial, I will show you how to install Python 3.8.3 on Raspberry Pi running raspbian on it.
1. Update the Raspbian
Update the Raspbian before installing python.
sudo apt-get update
Read Also: How to install python 3.7 on Ubuntu 16.04 / 18.04
2. Prerequisites
Before installing Python 3.8 there are some dependencies that we need to install. Use the following command to install the required dependencies.
sudo apt-get install -y build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev tar wget vim
3. Install pyenv Raspberry PI
First of all, let’s install pyenv on Debian (https://github.com/pyenv/pyenv)
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
Read Also: How to install postgresql 11 on Debian 8 / 9
4. Define environment variable
$ echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc && echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
5. Source the Bashrc
Now let’s source the .bashrc file
source ~/.bashrc
6. Check pyenv
Now we can check if pyenv has been installed by using the following command
7. Install Python 3.8.3
Now we will extract and install Python from the source.
$ pyenv install 3.8.3
Downloading Python-3.8.3.tar.xz...
-> https://www.python.org/ftp/python/3.8.3/Python-3.8.3.tar.xz
Installing Python-3.8.3...
Installed Python-3.8.3 to /home/pi/.pyenv/versions/3.8.3
https://installvirtual.com/how-to-connect-raspberry-pi-to-wifi-without-a-monitor/
8. Check Python
Now Python is installed you can check the version using the following command.
$ pyenv versions
* system (set by /home/pi/.pyenv/version)
3.8.3
Now you have successfully installed Python 3.8.3 on Raspberry Pi.
If you like this tutorial please consider buying me a coffee!