sudo apt-get install python-dev #For Python 2.x use
sudo apt-get install libffi-dev #For Python 2.7 use:
sudo apt-get install python3-dev #For Python 3.x use
#or for a specific version of Python 3, replace x with the minor version in
sudo apt-get install python3.x-dev