How do I install M2Crypto on Ubuntu?

do you have the python2.6-dev package installed? this is the package that contains the Python.h file you are missing


You probably need to install the python development packages:

sudo apt-get install python-dev

Better yet, don't bother building m2crypto yourself. It's already in the Ubuntu repositories as a fully supported package. This way, you'll get automatic updates through the same means as the rest of your Ubuntu system:

sudo apt-get install python-m2crypto

Maybe someone will get openssl related errors, try this:

sudo apt-get install openssl
sudo apt-get install libssl-dev