Tag: python docx

错误:ImportError:没有名为docx的模块 – >使用nodeJS python-shell包来控制python脚本

我正在尝试一些相对简单但是出现这个错误: Error: ImportError: No module named docx 这是我的nodeJS脚本: const python = require('python-shell'); const shell = new python('../Python/test.py'); let names = ['Hubert', 'Rupert', 'Sherbert', 'Wubbert', 'Paul']; shell.send(JSON.stringify(names)); shell.on('message', message => console.log(message)); shell.end(message => {console.log(message)}); python脚本“test.py”: import sys, json from docx import Document names = json.loads(sys.stdin.readlines()[0]) document = Document('test.docx') for name in names: for paragraph in document.paragraphs: […]