how to generate reference documentation locally

I’m trying to generate updated docs from latest git source, but when executing

python direct/src/directscripts/extract_docs.py

I get this error:

Traceback (most recent call last):
  File "direct/src/directscripts/extract_docs.py", line 12, in <module>
    from panda3d.dtoolconfig import *
ImportError: dynamic module does not define init function (initdtoolconfig)