Install New Python-3+ Releases on Ubuntu

Ahmed Shibli
Dec 30, 2016 · 1 min read

Python, 3.7.1 released recently. It has some exciting features. After downloading python source from, I faced few problems in installing from source, like this zlib library problem. There were so many solutions, yet none of them are working for me. After searching for answers and banging my head on walls for a while, I finally found the solution on official python site’s build dependency documentation.

sudo apt-get build-dep python3.6

If you see something like this, Open Software & Updates and enable:Source code, you can see details on this askubuntu Q&A.

If that package is not available for your system, try reducing the minor version until you find a package that is available in your system’s package manager.

Now, extract the source.

tar xzvf Python-3.*.tgz

Go to the extracted folder.

cd Python-3.*

Next, configure with the flag: --enable-optimizations

./configure --enable-optimizations

Then execute,


And, finally:

sudo make altinstall

*Alternatively, you can run the command: sudo make install. But, this will replace your default python version with this new one, which may cause problems to your OS, and other libraries using default python.

Lonely Coder

A Full-Stack Software Developer From Dhaka, Bangladesh

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store