ImportError: cannot import name Document

て烟熏妆下的殇ゞ 提交于 2021-02-08 04:29:31

问题


When I am running

from docx import Document 

I am getting error as

ImportError: cannot import name Document

I am working on Python 2.7.


回答1:


It looks like you have installed only docx, but I tried with this and worked for me:

pip uninstall docx

pip install python-docx

This way you will be using the newest version of the library, hope you find it useful.



来源:https://stackoverflow.com/questions/53674449/importerror-cannot-import-name-document

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!