On Ubuntu 14.04.4 LTS I was trying to install courseara-dl with the default python 3.4.3 and met the error:
src/MD2.c:31:20: fatal error: Python.h: No such file or directory
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Failed building wheel for pycrypto
The following packages have unmet dependencies:
python3.4-dev : Depends: python3.4 (= 3.4.0-2ubuntu1) but 3.4.3-1ubuntu1~14.04.3 is to be installed
Depends: libpython3.4-dev (= 3.4.0-2ubuntu1) but it is not going to be installed
Depends: libpython3.4 (= 3.4.0-2ubuntu1) but 3.4.3-1ubuntu1~14.04.3 is to be installed
Depends: libexpat1-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
dpkg -l | grep python 3
apt-get uninstall 3.4.3
ii python3 3.4.0-0ubuntu2 amd64 interactive high-level object-oriented language (default python3 version)
ii python3.4 3.4.3-1ubuntu1~14.04.3 amd64 Interactive high-level object-oriented language (version 3.4)
I don't remember exactly how I got python 3.4.3 in my Ubuntu, maybe through ubuntu auto upgrade?
The problem was
apt-cache policy libexpat1 libexpat1: Installed: 2.1.0-4ubuntu1.1 Candidate: 2.1.0-4ubuntu1.1 Version table: *** 2.1.0-4ubuntu1.1 0 100 /var/lib/dpkg/status 2.1.0-4ubuntu1 0 500 http://us.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
2.1.0-4ubuntu1 was needed for python3-dev and version
2.1.0-4ubntu1.1 was installed.
I also removed python3.4.3 and had to reinstall python3 (python3.4.0).
After that, I was able to install
Similar problems exist for my python2 where I had python2.7.6 but
python2.7.5. I did not borther to downgrade python2 since I am not really using it at the moment.
Thanks @matt-schuchard Matt Schuchard for pointing a direction. I am still not sure everything is correct but at least I was able to install