Skip to content

Instantly share code, notes, and snippets.

@MembrilloAmarillo
Created February 20, 2026 13:31
Show Gist options
  • Select an option

  • Save MembrilloAmarillo/548c0a7b70477e720df2527ccbe4d4a9 to your computer and use it in GitHub Desktop.

Select an option

Save MembrilloAmarillo/548c0a7b70477e720df2527ccbe4d4a9 to your computer and use it in GitHub Desktop.
Automatic download and compilation of Python2.7.18
wget https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tgz
tar xvf Python-2.7.18.tgz
cd Python-2.7.18
./configure
line_num=$(grep -n 'CFLAGS' Makefile | head -1 | cut -d: -f1)
sed -i "${line_num}s/$/ -std=c99/" Makefile
make -j8
PY_PATH=$(pwd)/python
echo $PY_PATH
sudo ln -s $PY_PATH /usr/bin/python2.7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment