目录 1. 安装docx包 2. 导入使用 3.报错分析及解决方法 4. 将word转化为txt文本 5. docx模块的其他用法 1. 安装docx包 测试环境:Windows10,Python3.6.3 / Python3.8 命令如下: pip3 install docx 安装成功截图: 2. 导入使用 安装完成后导入使用: 测试代码: import docx def docx_to_txt(): # 打开文件 file = docx.opendocx("./测试文件.docx")