Install Python 3.8.1 on Raspberry Pi
In this tutorial, I will show you how to install Python 3.8.1 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
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
6. Check pyenv
Now we can check if pyenv has been installed by using the following command
7. Install Python 3.8.1
Now we will extract and install Python from the source.
$ pyenv install 3.8.1
Installed Python-3.8.1 to /home/pi/.pyenv/versions/3.8.1
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)
Now you have successfully installed Python 3.8.1 on Raspberry Pi.
If you like this tutorial please consider buying me a coffee!
Thanks for the instructions, but what is the link to the Philips toaster on Amazon doing there? 😀
hahahahaha that was by mistake. My stupidity.
I Just removed it.
Thanks for letting me know.