Ao construir o python a partir da fonte usando o repositório mercurial.
Descomente as linhas deb-src
localizadas em /etc/apt/sources.list
Por exemplo:
## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu/ yakkety-updates main restricted
# deb-src http://archive.ubuntu.com/ubuntu/ yakkety-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://archive.ubuntu.com/ubuntu/ yakkety universe
# deb-src http://archive.ubuntu.com/ubuntu/ yakkety universe
deb http://archive.ubuntu.com/ubuntu/ yakkety-updates universe
# deb-src http://archive.ubuntu.com/ubuntu/ yakkety-updates universe
Ubuntu 16.10:
sudo nano /etc/apt/sources.list
sudo apt-get update
sudo apt-get build-dep python-defaults python3