Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save questionlp/628e48052a53a7e69ce8301c1f73a57b to your computer and use it in GitHub Desktop.

Select an option

Save questionlp/628e48052a53a7e69ce8301c1f73a57b to your computer and use it in GitHub Desktop.
Building Python 3 on Ubuntu 22.04 or Debian 12

Building Python 3 on Ubuntu 22.04 LTS or Debian 12

Installing Required Packages

sudo apt install build-essential checkinstall libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libreadline-dev libffi-dev python3-pip python3-venv liblzma-dev

Building Python

First, download and extract the desired version of Python 3 as a tarball and extract the tarball. Change into the extracted source directory and run:

sudo ./configure --enable-optimizations
sudo make altinstall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment