我正在尝试使用 python 中的 docx 库来考虑 word 文档。问题是,无论我导入什么,我都会收到有关“无属性”的错误消息。例如 - 文档
from docx import Document
给出输出
cannot import name Document
任何尝试使用 Document 都会以错误结束
AttributeError: 'module' object has no attribute 'Document'
任何语法似乎都是正确的。我正在使用 docx 模块版本 0.2.4 。
感谢您的所有帮助。
我有类似的问题。我曾经用过pip install docx
在我的虚拟环境中。解决办法是pip uninstall docx
进而pip install python-docx
.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)