When I try to import docx, I get this error:
Traceback (most recent call last):
File "C:\Users\kinga\PycharmProjects\InvoiceGenerator\main.py", line 8, in <module>
import docx
ModuleNotFoundError: No module named 'docx'
and shows this on Command Prompt (I am using JetBrains' PyCharm IDE on Windows operating system)
I tried
pip install python-docx
but it didn't work.
edit: importing via "from docx import Document" yields this
Traceback (most recent call last): File "C:\Users\kinga\PycharmProjects\InvoiceGenerator\main.py", line 8, in from docx import Document File "C:\Users\kinga\PycharmProjects\InvoiceGenerator.venv\Lib\site-packages\docx.py", line 30, in from exceptions import PendingDeprecationWarning ModuleNotFoundError: No module named 'exceptions'
When I try to import docx, I get this error:
Traceback (most recent call last):
File "C:\Users\kinga\PycharmProjects\InvoiceGenerator\main.py", line 8, in <module>
import docx
ModuleNotFoundError: No module named 'docx'
and shows this on Command Prompt (I am using JetBrains' PyCharm IDE on Windows operating system)
I tried
pip install python-docx
but it didn't work.
edit: importing via "from docx import Document" yields this
Traceback (most recent call last): File "C:\Users\kinga\PycharmProjects\InvoiceGenerator\main.py", line 8, in from docx import Document File "C:\Users\kinga\PycharmProjects\InvoiceGenerator.venv\Lib\site-packages\docx.py", line 30, in from exceptions import PendingDeprecationWarning ModuleNotFoundError: No module named 'exceptions'
Share Improve this question edited Feb 21 at 5:15 Arjun Ravendran asked Feb 21 at 3:15 Arjun RavendranArjun Ravendran 112 bronze badges 1 |1 Answer
Reset to default 0How about this way of importing? "from docx import Document" [1]: https://python-docx.readthedocs.io/en/latest/
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745168876a4614800.html
pip show python-docx
. Refer tohttps://pip.pypa.io/en/stable/cli/pip_show/
– Kepler452B Commented Feb 21 at 3:50