Windows 上的 python pip - 命令“cl.exe"失败 [英] python pip on Windows - command 'cl.exe' failed

查看:48
本文介绍了Windows 上的 python pip - 命令“cl.exe"失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 pip install spacy 安装 spaCy,但出现以下错误..

I'm trying to install spaCy using pip install spacy but I'm getting the following error ..

我安装了 VS 2015,并且安装了以下 Python ..

I have VS 2015 installed, and I have the following Python install ..

<代码>3.5.2 |Anaconda 2.5.0(64 位)|(默认,2016 年 7 月 5 日,11:41:13)[MSC v.1900 64 位 (AMD64)]

我尝试了以下 SO 解决方案无济于事..

I tried the following SO solutions to no avail ..

以及其他各种.这不是这个特定库的独特问题,而是更普遍的问题,当我尝试安装需要 C 在 Windows 上构建的 Python 库时.

As well as various others. This is not a unique problem to this specific library but more generally anytime I try to install Python libraries that need C to build on Windows.

推荐答案

您正在安装一个包含用 C/C++ 编写的部分的包,因此您需要有 cl.exe(Microsoft C 编译器) 安装在您的计算机和 PATH 中.PATH 是一个环境变量,它告诉 Windows 在哪里可以找到可执行文件.

You are installing a package with parts written in C/C++, so you need to have cl.exe (the Microsoft C Compiler) installed on your computer and in your PATH. PATH is an environment variable that tells Windows where to find executable files.

首先,确保安装了适用于 Visual Studio 的 C++ 构建工具.

First, ensure the C++ build tools for Visual Studio are installed.

  • If you already have Visual Studio on your computer, install Desktop development with C++ from the Visual Studio Installer, which you should have in Start Menu.
  • Otherwise, you can download Build Tools for Visual Studio separately from the Visual Studio downloads page (near the bottom of the page), then choose C++ build tools from the installer.

然后,使用开始菜单中的 Visual Studio 文件夹中的特殊命令提示符之一,而不是普通的命令提示符或 PowerShell.这会自动设置PATH,以便可以找到cl.exe.

Then, instead of the normal Command Prompt or PowerShell, use one of the special command prompts in the Visual Studio folder in Start Menu. This sets up PATH automatically, so that cl.exe can be found.

  • 对于 32 位 Python,请使用 x86 本机工具命令提示符.
  • 对于 64 位 Python,请使用 x64 本机工具命令提示符.

这篇关于Windows 上的 python pip - 命令“cl.exe"失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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