Skip to content

Instantly share code, notes, and snippets.

@roryrjb
Last active June 23, 2024 07:09
Show Gist options
  • Save roryrjb/982b6e4a67a27016f44c8a0f1cba01d8 to your computer and use it in GitHub Desktop.
Save roryrjb/982b6e4a67a27016f44c8a0f1cba01d8 to your computer and use it in GitHub Desktop.
Install Python (on Ubuntu 24.04)
sudo apt update
sudo apt install -y build-essential pkgconf libssh-dev libz-dev uuid-dev liblzma-dev libreadline-dev libffi-dev libbz2-dev
cd "$(mktemp -d)"
curl -LO https://www.python.org/ftp/python/3.11.9/Python-3.11.9.tgz
tar xvf Python-3.11.9.tgz
cd Python-3.11.9/
./configure --prefix ~/opt/python --enable-optimizations
make -j$(nproc)
make install
~/opt/python/bin/python3 -m pip install --upgrade --user pip
# add ~/opt/python/bin and ~/.local/bin to your $PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment