Skip to content

Instantly share code, notes, and snippets.

@Wombatpm
Created June 2, 2020 14:40
Show Gist options
  • Save Wombatpm/94feaed416733185f53d69688255792c to your computer and use it in GitHub Desktop.
Save Wombatpm/94feaed416733185f53d69688255792c to your computer and use it in GitHub Desktop.
Build Python3 from source for Ubuntu Xenial
#At a shell prompt (in a terminal), run
sudo apt-get update \
&& sudo apt-get install -y build-essential git libexpat1-dev libssl-dev zlib1g-dev \
libncurses5-dev libbz2-dev liblzma-dev \
libsqlite3-dev libffi-dev tcl-dev linux-headers-generic libgdbm-dev \
libreadline-dev tk tk-dev wget
git clone https://github.com/python/cpython.git
cd cpython && ./configure --prefix=/usr \
--enable-loadable-sqlite-extensions \
--enable-shared \
--with-lto \
--enable-optimizations \
--with-system-expat \
--with-system-ffi \
--enable-ipv6 --with-threads --with-pydebug --disable-rpath \
&& make \
&& sudo make altinstall
#This will fetch all the common packages you need to build anything (e.g. the compiler etc.).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment