我正在尝试从docx导入文档,但是发生了ModuleNotFoundError。
from docx import Document
# just for testing:
doc = Document()
运行此命令时,我得到以下输出:
Traceback (most recent call last):
File "C:/Users/finnm/PycharmProjects/MesseMahlzeiten/TestScipt.py", line 1, in <module>
from docx import Document
ModuleNotFoundError: No module named 'docx'
由于这可能会有所帮助,因此我向您展示了哪些pip安装输出:
C:\Users\finnm>pip install python-docx
Collecting python-docx
Using cached https://files.pythonhosted.org/packages/e4/83/c66a1934ed5ed8ab1dbb9931f1779079f8bca0f6bbc5793c06c4b5e7d671/python-docx-0.8.10.tar.gz
Requirement already satisfied: lxml>=2.3.2 in c:\users\finnm\appdata\local\programs\python\python36\lib\site-packages (from python-docx) (4.4.1)
Installing collected packages: python-docx
Running setup.py install for python-docx ... done
Successfully installed python-docx-0.8.10
答案 0 :(得分:1)