如何在 python 模块 docx 中导入文档? [重复]

问题描述 投票:0回答:1

我正在使用 mac 并使用 pip 安装 python-docx。我进入 C:\Python27\Scripts 并运行

pip install python-docx

我觉得应该已经安装好了

但是当我运行一个简单的导入

from docx import Documents

它遇到了一个

ImportError: No module named docx  

当我检查使用 pip 安装的模块时

pip list
python-docx 0.8.11 已安装。

为什么会这样?

python python-2.x docx python-docx
1个回答
0
投票

请尝试安装

python-docx
:

$ pip uninstall docx
$ pip install python-docx
© www.soinside.com 2019 - 2024. All rights reserved.