Last active
June 23, 2024 07:09
-
-
Save roryrjb/982b6e4a67a27016f44c8a0f1cba01d8 to your computer and use it in GitHub Desktop.
Install Python (on Ubuntu 24.04)
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
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