The missing "pyconfig.h" error happens when I run pip install -e ".[dev]". Installing the python-dev package (which is listed as a dependency for PostgreSQL later in the same guide) solves the problem. But it lead to "/usr/bin/ld: cannot find -lz" error which I solved by installing the libz-dev package. This is on an up-to-date fresh Debian Jessie 64-bit VM installation. I am guessing this could be applicable to Ubuntu as well. Need to update dev_hacking.rst to specify installing these packages.