Why can't I install python3.6-dev on Ubuntu 16.04?

Posted on Apr 21, 2023

Question

I am trying to install it with this command:

sudo apt-get install python3.6-dev

But I'm getting this error:

E: Unable to locate package python3.6-dev
E: Couldn't find any package by glob 'python3.6-dev'
E: Couldn't find any package by regex 'python3.6-dev'

Why am I getting this error and what is the correct way to install the package?

Answer

The package is not available in 16.04. But if you need it in 16.04 you can add the deadsnakes package repository:

sudo add-apt-repository ppa:deadsnakes/ppa \
&& sudo apt update \
&& sudo apt install python3.6