python - 如何在 python 模块 docx 中导入文档?
问题描述
嗨,我正在使用 mac 并使用 pip 安装 python-docx。我进入 C:\Python27\Scripts 并运行
pip install python-docx
我认为它应该已经安装了。
但是当我运行一个简单的导入
from docx import Documents
它遇到了一个
"ImportError: No module named docx" when i checked the modules installed using pip using ```pip list``` python-docx 0.8.11 is installed.
有谁知道为什么会这样?
解决方案
请尝试安装python-docx
:
$ pip uninstall docx
$ pip install python-docx
推荐阅读
- python - 如何在 python、CDO 或 NCO 中对 netcdf 字段进行空间聚合?
- c++ - 编译器如何知道不优化 atomic_bool 上的读取?
- javascript - Next.js 具有 i18n 和共享组件的多区域
- javascript - 下载带有格式化日期的 CSV
- javascript - 从数组中的嵌套对象中删除对象属性
- python - CMAP 返回 'TypeError: int() 参数必须是字符串、类似字节的对象或数字,而不是 'list''
- jwt - 我有问题,我无法获取刷新令牌
- instrumentation - 调试未完成跟踪的最佳实践
- apache-spark - 在 Spark SQL 中使用 Presto JDBC 时无法识别的连接属性“url”
- rest - 我可以在我的 RESTful API 中使用重定向来为用户特定的内容设置别名吗