Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: cannot import name Document

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.

like image 876
Siddhi Sawant Avatar asked Dec 23 '22 02:12

Siddhi Sawant


1 Answers

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.

like image 112
Leonardo Hernández Avatar answered Dec 28 '22 08:12

Leonardo Hernández