Python-docx: "package not found"
I have a doc.docx file at '/ var / code / oa'. I need to read it using python-docx. I am writing this:
from docx import Document
document = Document('/var/code/oa/doc.docx')
then you get an error .. PackageNotFoundError: package not found in '/var/code/oa/doc.docx'
why?
Thanks @soon. Oh, this is stupid. the cause is the file, it should be docx
. I just change the filename from doc
to docx
, this is not really a file docx
.
+3
source to share