通过 pip 安装 lxml 时出错:需要 Microsoft Visual C++ 14.0 [英] Error while installing lxml through pip: Microsoft Visual C++ 14.0 is required
问题描述
我在 Windows 10 机器上,最近从 python 2.7 迁移到 3.5.尝试通过 pip 安装 lxml 时,它会停止并抛出此错误消息 -
构建lxml.etree"扩展
错误:需要 Microsoft Visual C++ 14.0.使用Microsoft Visual C++ 构建工具"获取它:
I am on a windows 10 machine and recently moved from python 2.7 to 3.5. When trying to install lxml through pip, it stops and throws this error message-
building 'lxml.etree' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
I have a working copy of VS 2015 installed. When I try to install the visual cpp tools through that link, it says that Microsoft Visual Studio 2015 is already installed on the machine. I also tried installing visual studio c++ 2015 redistributables, both 64 and 32 bit versions, but both of them say that there's another version of the product already installed.
typing set in the command prompt includes this -
VS140COMNTOOLS=C:Program Files (x86)Microsoft Visual Studio 14.0Common7Tools
Which means that the path is set.
This is probably the only resource I could find on SO, but the answer suggests rolling back to Python 3.4.3 from 3.5. Has anybody resolved problems of this kind?
Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat)
EDIT: I managed to install it using the precompiled binary (Thanks Paul), but I would still like to know what's causing this.
Have you checked that when you installed Visual Studio, you installed the C++ compiler? It seems like a silly question, but this is the mistake I made. Check by going into the setup for visual studio (Programs and features: Modify "Visual Studio 2015"), then under Programming Languages->VC++
, make sure it's ticked.
这篇关于通过 pip 安装 lxml 时出错:需要 Microsoft Visual C++ 14.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!