You should install python development package. The package contains Python header files and static libraries that is needed when build Python extensions.
If you installed the Python using apt-get
, you can install python development package by using following command (need root permission):
apt-get install python3.1-dev