from exceptions import PendingDeprecationWarning ModuleNotFoundError: No module named 'exceptions'

Viewed 4469

I am trying to create a word document with Python. I did pip install python-docx in my terminal.

My code looks like this:

from docx import Document

document = Document()
document.save('Test.docx')

I could not create a new document. What am I missing? The existing answer to install python-docx did not work for me.

from exceptions import PendingDeprecationWarning 
ModuleNotFoundError: No module named 'exceptions'
2 Answers

you need to install

"python-docx"

by

pip install python-docx 

Try pip freeze and check whether the module name is listed or not.

Related