While installing Readthedocs package inside Virtual Environement on Ubuntu We found this error “Python headers are required to build Mercurial but weren’t found in /usr/include/python2.7/Python.h”.
The problem seems to be dependency issue with the header files for python.
To solve this problem we have to install the python-dev package .
The solution will work in Ubuntu and Debian based Operating System.
sudo apt-get update
sudo apt-get install python-dev
Now try installing the packages again, we hope it will fix your issue too.
Did not work, waste of time
Note that for RedHat/Centos, it’s yum install python-devel
Thank you, it is very helpful for me!!!