关于 Word 操作时的 ImportError: No module named 'exceptions' 报错问题

今天测试 Word 文档操作时,运行出现了如下错误:
关于 Word 操作时的 ImportError: No module named 'exceptions' 报错问题

查询原因为:The exceptions module does not exist in Python 3 (exceptions defined there were added to __builtin__anyway). Looks like the conversion of DocX to Python 3 is not complete yet.
就是说 docx 这个包,不是很适应 Python3X 版本。

如果您使用的是 python 3x,请不要安装 docx

pip install python-docx

它与 python 3x 兼容

官方文件:https//pypi.org/project/python-docx/