Docx library does not recognize Document method
I am trying to use the docx library, but I am getting this error:
AttributeError: 'module' object has no attribute 'Document'
This is my code:
import docx
document = docx.Document('file.docx')
What's happening? I have already used the document on other computers. I installed the docx library using pip:
pip install docx
+3
source to share