My book: Master your Raspberry Pi in 30 days.Can a Raspberry Pi 4 really Replace your Desktop PC?.Top Raspberry Pi HATs to easily add new features.If you want to use the latest Python version with Thonny, you have to update this link as well. Note: If you are using Thonny to code in Python, it uses "/usr/bin/python3" by default, which links to the latest version installed by Raspberry Pi OS (3.7.3 in my case). It should now display the version you just installed (3.9.5 for me). Sudo ln -s /usr/local/bin/python3.9 python Link the version you intend to use instead:.Here is what it looks like on a fresh RPI OS install: Or you can replace the link in your /usr/local/bin folder to point to the version you want to use as default ( more details here).Which is probably the safer option if you switch from one version to another regularly. Always run a Python script with the exact version you want to use, for example:.To choose the version you want to run, you have two choices: python3.9 : The one I installed from sources.īut when I use “python –version”, I’m still using Python 2.7.python3.7 : The default Python 3 version on Raspberry Pi OS at the time of writing.python2.7 : The current Python 2 version by default.Replace the URL with the link you paste in the previous step.Ĭhange the Python version if you downloaded another one.Īre you a bit lost in the Linux command line? Check this article first for the most important commands to remember and a free downloadable cheat sheet so you can have the commands at your fingertips.Įach installed version of Python on your system adds a new executable in /usr/local/bin that you can use to run a program. If you need help with the SSH part, you can read my tutorial here which has all the information you might need. Right click on “Gzipped source tarball” and choose “Copy link address” from the browser contextual menu.įor the following, you need to open a terminal on Raspberry Pi OS, or connect via SSH to type a few commands.Scroll to the bottom of the next page, and find the list of download links:.Click on the “Download” link corresponding to the version you want to install.Look for the second table on that page “Looking for a specific release?”:.Download and extract the latest Python version Step 3: Configure the system to use the latest Python version.Step 2: Extract the files on the Raspberry Pi.Step 1: Download the latest version of Python from the official website.Install the latest Python version on Raspberry PiĪs Raspberry Pi OS is always a few Python versions late, the only way to install the latest Python version on your Raspberry Pi is to download the source code from the official website and install it manually: In the next section, we’ll learn how to update it on your Raspberry Pi. As you can see on the Download page, Python 3.7 was released in 2018. This first table gives you an overview of the latest Pythons versions. On the download page, the latest versions are listed with their release date and maintenance status. The easiest way to find the latest Python release available is to go to the official Python website. Raspberry Pi without Python is like a car without an engine, you miss all the fun parts. It will guide you step-by-step to learn the essential concepts (and only the essential concepts) required to achieve any project in the future. Follow my recommendations below and everything should work on the first try!īy the way, if you get overwhelmed as soon as Python is required for a project, I recommend checking out my e-book “ Master Python on Raspberry Pi“. Raspberry Pi OS repositories are generally late from a few versions.Īs always, I’m doing this on my Raspberry Pi, so you won’t have to face bugs and errors yourself. The only way to install the latest Python version on Raspberry Pi OS is to download it from the official website and install it from sources. In this article, I’ll tell and show you everything you need to know about the Python versions on your Raspberry Pi. But as often with computers and programming, it’s not always that simple. Raspberry Pi and Python work well together, and Python comes pre-installed on your Raspberry Pi OS.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |