Last active
January 22, 2023 21:15
-
-
Save ryancheley/a0069cdfd9653950a9be3873b7500d71 to your computer and use it in GitHub Desktop.
Install Python on Raspberry Pi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
<< comment | |
The script here expexts the version of Python you're trying to install with the Semantic Version MAJOR.MINOR.PATCH, i.e. 3.11.1. | |
If the version does not exist, an error will be generaeted | |
comment | |
sudo apt update | |
sudo apt upgrade -y | |
cd ~/Downloads/ | |
wget https://www.python.org/ftp/python/"$1"/Python-"$1".tgz | |
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libncurses5-dev libsqlite3-dev libreadline-dev libtk8.6 libgdm-dev libdb4o-cil-dev libpcap-dev -y | |
tar -xzvf Python-"$1".tgz | |
cd Python-"$1"/ | |
./configure --enable-optimizations | |
sudo make altinstall |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment