Skip to content

Instantly share code, notes, and snippets.

@copperlight
Last active August 17, 2019 07:09
Show Gist options
  • Save copperlight/953796d1bd1b9bd34ed3452a56daa45e to your computer and use it in GitHub Desktop.
Save copperlight/953796d1bd1b9bd34ed3452a56daa45e to your computer and use it in GitHub Desktop.
Install Python 3.7 on Raspbian Stretch
sudo apt-get install screen
screen
PACKAGES=(
"build-essential"
"libbz2-dev"
"libdb5.3-dev"
"libexpat1-dev"
"libffi-dev"
"libgdbm-dev"
"liblzma-dev"
"libncurses5-dev"
"libreadline-dev"
"libsqlite3-dev"
"libssl-dev"
"tk-dev"
"uuid-dev"
"zlib1g-dev"
)
unset INSTALL_SET
for P in "${PACKAGES[@]}"; do
INSTALL_SET="$INSTALL_SET $P"
done
sudo apt-get update
sudo apt-get install $INSTALL_SET
mkdir -p /apps
chown pi /apps /usr/local/src
cd /usr/local/src
VERSION=3.7.4
MAJOR=${VERSION:0:3}
curl -O https://www.python.org/ftp/python/$VERSION/Python-$VERSION.tar.xz
tar xvf Python-$VERSION.tar.xz
cd Python-$VERSION
./configure --prefix=/apps/python-$VERSION --enable-optimizations
make
make install
ln -nsf /apps/python-$VERSION /apps/python-$MAJOR
/apps/python-$MAJOR/bin/python3 -V
PATH=/apps/python-$MAJOR/bin:$PATH
python3 -V
@copperlight
Copy link
Author

copperlight commented Aug 17, 2019

  • ctrl-a, ctrl-d to detach from the screen session.
  • screen -list to list the existing sessions.
  • screen -r to re-attach to an existing session.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment