试图安装python-的docx(错误:无法找到vcvarsall.bat) [英] Attempting to install python-docx (error: Unable to find vcvarsall.bat)
问题描述
我已经尝试了一切,我不知道在哪里,从这里走。当我调用命令 PIP安装python-DOCX
我得到这样的:
I have tried everything and I have no idea where to go from here. When I call the command pip install python-docx
I get this:
running build_ext
building 'lxml.etree' extension
error: Unable to find vcvarsall.bat
----------------------------------------
Command "c:\users\alex\appdata\local\programs\python\python35-32\python.exe -c "import setuptools, tokenize;__file__='C:\\Users\\Alex\\AppData\\Local\\Temp\\pip-build-u2i_l872\\lxml\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\Alex\AppData\Local\Temp\pip-26nq6ot7-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Alex\AppData\Local\Temp\pip-build-u2i_l872\lxml
末
我曾尝试定位vsvarsall.bat并设置路径。我似乎无法找到它在C:\\ Program Files文件(x86)的\\微软的Visual Studio 14.0 \\ Common7 \\工具,也没有工具,文件夹C:\\ Program Files文件\\微软的Visual Studio 12.0 \\ Common7。我在64位的Windows 10和Python 3.5.1。
I have tried locating vsvarsall.bat and setting the path. I can't seem to find it in C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools and there is no tool folder in C:\Program Files\Microsoft Visual Studio 12.0\Common7. I'm on 64bit Windows 10 and python 3.5.1.
推荐答案
这是一个pretty常见的问题,人们遇到与Python模块。 你可以阅读更多起来就可以了这里
This is a pretty common issue people run into with Python modules. You can read up more on it here
你可以做的是安装一个$ P $ LXML的pcompiled版本,这是蟒蛇,DOCX依赖于一个模块。你可以,或者看的蟒蛇,DOCX GitHub的页面这里,其中列出了蟒蛇,DOCX所有要求。
What you can do is install a precompiled version of lxml, which is a module that python-docx relies upon. You can identify this requirement by looking at the error message, or by looking at the python-docx github page here, which lists all requirements for python-docx.
幸运的是,克里斯托弗Golke提供了一些precompiled模块对我们来说,可在这里。 < ---盗链,你会经常使用它
Luckily, Christoph Golke provides some precompiled modules for us, available here. <--- Hotlink that, you'll use it quite often.
下载,然后从克里斯托夫Golke先安装lxml的模块,然后尝试重新运行画中画安装。
Download and install the lxml module first from Christoph Golke, then try rerunning your pip install.
这篇关于试图安装python-的docx(错误:无法找到vcvarsall.bat)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!