通过pip安装lxml时出错:需要Microsoft Visual C ++ 14.0 [英] Error while installing lxml through pip: Microsoft Visual C++ 14.0 is required

查看:608
本文介绍了通过pip安装lxml时出错:需要Microsoft Visual C ++ 14.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows 10计算机上,最近从python 2.7移至3.5.尝试通过pip安装lxml时,它将停止并抛出此错误消息-

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-

构建'lxml.etree'扩展名
错误:需要Microsoft Visual C ++ 14.0.使用"Microsoft Visual C ++生成工具"获得它: http://landinghub.visualstudio.com/visual-cpp-build-tools

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

我已安装VS 2015的工作副本.当我尝试通过该链接安装Visual cpp工具时,它表示计算机上已经安装了Microsoft Visual Studio 2015.我还尝试安装64位和32位版本的Visual Studio c ++ 2015可再发行版本,但是他们俩都说已经安装了该产品的另一个版本.
在命令提示符下输入的键入集包括-

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.0 \ Common7 \ Tools \

VS140COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\

这意味着已设置路径.
这可能是我可以在SO上找到的唯一资源,但是答案建议从3.5回滚到Python 3.4.3.有人解决过这类问题吗?
需要Microsoft Visual C ++ 14.0(无法找到vcvarsall.bat)
我设法使用预编译的二进制文件(感谢Paul)安装了它,但我仍然想知道是什么原因造成的.

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)
I managed to install it using the precompiled binary (Thanks Paul), but I would still like to know what's causing this.

推荐答案

您是否检查过安装Visual Studio时是否安装了C ++编译器?看来这是一个愚蠢的问题,但这是我犯的错误.通过进入Visual Studio的设置进行检查(程序和功能:修改"Visual Studio 2015"),然后在Programming Languages->VC++下,确保已选中它.

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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆