Errors while importing python-docx - Stack Overflow

When I try to import docx, I get this error:Traceback (most recent call last):File "C:Usersking

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
  • You can run this command in your terminal or command prompt to check if python-docx is installed: pip show python-docx. Refer to https://pip.pypa.io/en/stable/cli/pip_show/ – Kepler452B Commented Feb 21 at 3:50
Add a comment  | 

1 Answer 1

Reset to default 0

How 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

相关推荐

  • Errors while importing python-docx - Stack Overflow

    When I try to import docx, I get this error:Traceback (most recent call last):File "C:Usersking

    14小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信