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

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?

Asked By: Sanjit kumar

||

Answers:

The package is too new. It’s not available in the older 16.04 release. It’s available in the newer Ubuntu 16.10.

Answered By: omajid

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
Answered By: Jobomat
sudo add-apt-repository ppa:deadsnakes/ppa

I guess they changed the name of repository.

Answered By: sushrut619

For those who tried to install Python 3.6 and got same error as that one above, this can help you as well as us. It helped me fix out the problem.

  1. Open a terminal and then run this command to add the PPA:

    sudo add-apt-repository ppa:jonathonf/python-3.6
    
  2. Then check updates and install Python 3.6 via commands:

    sudo apt-get update
    
    sudo apt-get install python3.6
    

Now to make sure you had install successfully, just run python3.6-v or python3.6

For more details, check at "How to Install Python 3.6.1 in Ubuntu 16.04 LTS".

Note: Linux 16.04 uses Python v 2.7 as the default one. If you need to use Python 3.6 in your project, just set python-3.6 as the default version for this project. It’s better than
using the sudo update-alternatives ... command, and then your terminal will vanish :(.

Answered By: DINA TAKLIT

This ppa worked like a charm on ubuntu 16.04. Posting here for others.

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python3.6
Answered By: Aquarius

This ppa:jonathonf did not work for me.

 ppa:deadsnakes 

is working fine for now.

What worked was:

  1. Open a terminal

  2. Execute the following commands:

    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get install software-properties-common
    sudo add-apt-repository ppa:deadsnakes/ppa
    sudo apt-get update
    sudo apt-get install python3.6
    
Answered By: Khomesh Pathekar
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.