我需要通过 Python 3.4 在 Word 文档中创建表格。为此,我尝试在 Windows 中安装 python-docx。如果我使用 pip install python-docx 我会收到以下错误:
vcvarsall.bat error
所以我安装了 Visual Studio 然后尝试安装它,但我仍然得到以下信息:
error: Setup script exited with error: command '"C:\Program Files (x86)\Microsoft Visual
Studio 10.0\VC\BIN\cl.exe"' failed with exit status 2
请您参考如下方法:
这是 lxml 安装的问题。如果您使用 Windows 二进制包单独安装 lxml,然后重新安装 python-docx,此错误应该会消失。
您可以在此处找到二进制 lxml 包:http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml
