The docx.enum.base module fails to load when python is run with -OO optimizations turned on, which means that docx itself cannot be imported.
The issue is in line 60 of docx.enum.base.py:
cls_docstring = self._clsdict['__doc__']
A KeyError is not raised, but instead cls_docstring is set to None, which causes the textwrap.dedent call to fail.