Docx缺少属性 [英] Docx missing attributes
本文介绍了Docx缺少属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用python中的docx库考虑Word文档的任何事情.问题是,无论我导入什么,都会收到有关无属性"的错误消息.对于示例-文档
来自docx导入文档的
提供输出
无法导入名称文档
任何尝试使用文档的尝试都以错误结束
AttributeError:模块"对象没有属性文档"
任何语法似乎都是正确的.我正在使用docx模块版本0.2.4.
感谢所有帮助.
解决方案
来自官方文档
python-docx版本0.3.0和更高版本与以前的版本不兼容.
因此,请尝试更新软件包或使用旧的 api >
I'm trying to do anything considering word document using docx library in python. The problem is, whatever I import, I get error message about 'no attribute'. For eample - Document
from docx import Document
gives output
cannot import name Document
and any try to use Document ends with error
AttributeError: 'module' object has no attribute 'Document'
Any syntax seems to be correct. I'm using docx module version 0.2.4 .
Thanks for all help.
解决方案
python-docx versions 0.3.0 and later are not API-compatible with prior versions.
so, try to update package or use old api
这篇关于Docx缺少属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文