Skip to content

Instantly share code, notes, and snippets.

@ryancheley
Last active January 22, 2023 21:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryancheley/a0069cdfd9653950a9be3873b7500d71 to your computer and use it in GitHub Desktop.
Save ryancheley/a0069cdfd9653950a9be3873b7500d71 to your computer and use it in GitHub Desktop.
Install Python on Raspberry Pi
#!/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