How To Install Python 3.12.3 On The Raspberry Pi
How To Install Python 3.12.3 On The Raspberry Pi
3 on the Raspberry Pi
T
B
p
th
P
m
y
W
https://aruljohn.com/blog/python-raspberrypi/ 1/15
3/28/25, 9:53 PM How to Install Python 3.12.3 on the Raspberry Pi
I use Python for various purposes all my Raspberry Pi boards. I run automated
scripts, web applications that help in home automation, web controllable
Christmas lights and more recently AI/machine learning.
wget https://www.python.org/ftp/python/3.12.3/Python-3.12.3.tgz
$ wget https://www.python.org/ftp/python/3.12.3/Python-3.12.3.tgz
--2024-05-21 14:23:57-- https://www.python.org/ftp/python/3.12.3/Python
Resolving www.python.org (www.python.org)... 151.101.40.223, 2a04:4e42:7
Connecting to www.python.org (www.python.org)|151.101.40.223|:443... con
HTTP request sent, awaiting response... 200 OK
Length: 27159482 (26M) [application/octet-stream]
Saving to: ‘Python-3.12.3.tgz’
Python-3.12.3.tgz 100%[=====================================>]
https://aruljohn.com/blog/python-raspberrypi/ 2/15
3/28/25, 9:53 PM How to Install Python 3.12.3 on the Raspberry Pi
Next, we run configure and make. The configure command may take several
minutes depending on your Raspberry Pi. On my Raspberry Pi v3, this took about
45 minutes.
./configure --enable-optimizations
sudo make altinstall
./configure
sudo make altinstall
/usr/local/bin/python3.12 -V
Python 3.12.2
https://aruljohn.com/blog/python-raspberrypi/ 3/15
3/28/25, 9:53 PM How to Install Python 3.12.3 on the Raspberry Pi
When you run python, you will still get the default 3.11.2.
/usr/bin/python3 -V
Python 3.11.2
To make the default version of Python 3.12.3, create a softlink. Run this:
sudo rm /usr/bin/python
sudo ln -s /usr/local/bin/python3.12 /usr/bin/python
If that does not work, repeat the process for python3 instead of python.
sudo rm /usr/bin/python3
sudo ln -s /usr/local/bin/python3.12 /usr/bin/python3
sudo rm /usr/local/bin/python
sudo ln -s /usr/local/bin/python3.12 /usr/local/bin/python
python -VV
Python 3.12.3
If you want to know which version of Python has precedence, you can use the
which command.
$ which python
/usr/local/bin/python
https://aruljohn.com/blog/python-raspberrypi/ 4/15
3/28/25, 9:53 PM How to Install Python 3.12.3 on the Raspberry Pi
$ which python3
/usr/local/bin/python3
You can also check your Python versions using the whereis command.
$ whereis python
python: /usr/bin/python /usr/share/man/man1/python.1.gz
$ whereis python3
python3: /usr/bin/python3 /usr/lib/python3 /etc/python3 /usr/local/bin/p
cd /tmp/
rm -rf rm -rf Python-3.12.3.tgz Python-3.12.3/
Conclusion
Let me know whether you have any problems installing Python 3.12.3 in your
Raspberry Pi.
This blog post will be regularly updated, usually once in two months.
Related Posts
https://aruljohn.com/blog/python-raspberrypi/ 5/15
3/28/25, 9:53 PM How to Install Python 3.12.3 on the Raspberry Pi
https://aruljohn.com/blog/python-raspberrypi/ 6/15
3/28/25, 9:53 PM How to Install Python 3.12.3 on the Raspberry Pi
Disclaimer: Our website is supported by our users. We sometimes earn affiliate links when
you click through the affiliate links on our website.
Last Updated: July 02, 2024. This post was originally written on August 10, 2021.
Comments
Leave a Message
Your email address will not be published. All fields are required.
https://aruljohn.com/blog/python-raspberrypi/ 7/15
3/28/25, 9:53 PM How to Install Python 3.12.3 on the Raspberry Pi
Thank you for this post, even if it doesn't work yet for me I learned
a lot :)
sudo rm /usr/local/bin/python
sudo ln -s /usr/local/bin/python3.12 /usr/local/bin/python
https://aruljohn.com/blog/python-raspberrypi/ 8/15
3/28/25, 9:53 PM How to Install Python 3.12.3 on the Raspberry Pi
Much appreciated
https://aruljohn.com/blog/python-raspberrypi/ 9/15
3/28/25, 9:53 PM How to Install Python 3.12.3 on the Raspberry Pi
https://aruljohn.com/blog/python-raspberrypi/ 10/15
3/28/25, 9:53 PM How to Install Python 3.12.3 on the Raspberry Pi
Arul John wrote on 2024-01-04
Thank you, Harmen. I updated the blog post.
sudo rm /usr/bin/python3
sudo ln -s /usr/local/bin/python3.12 /usr/bin/python3
Thanks,
Shane
https://aruljohn.com/blog/python-raspberrypi/ 11/15
3/28/25, 9:53 PM How to Install Python 3.12.3 on the Raspberry Pi
Supra, yes, you can. Just make sure that your OS doesn't have any
dependencies on 3.7.3. I prefer to leave the older versions alone if
they come with the default OS.
Categories
-select category-
Recent Articles
https://aruljohn.com/blog/python-raspberrypi/ 12/15
3/28/25, 9:53 PM How to Install Python 3.12.3 on the Raspberry Pi
RubyConf 2013
Popular Articles
How to find IP address of email sender
Comments
✏ Blog Comments
Our books
https://aruljohn.com/blog/python-raspberrypi/ 13/15
3/28/25, 9:53 PM How to Install Python 3.12.3 on the Raspberry Pi
https://aruljohn.com/blog/python-raspberrypi/ 14/15
3/28/25, 9:53 PM How to Install Python 3.12.3 on the Raspberry Pi
home about me contact me articles & blog code Bible Costco gas prices APIs
https://aruljohn.com/blog/python-raspberrypi/ 15/15