简体   繁体   English

错误:命令 'C:\\ Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.14.26428\\bin\\HostX86\\x64\\cl.exe' 失败,退出状态为 2

[英]error: command 'C:\\ Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.14.26428\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2

Hi so I was trying to pip install python-ldap using my git bash but at first it told me that i don't have cl.exe so i downloaded the visual studio C++ pack now it's showing this error嗨,所以我尝试使用我的 git bash pip install python-ldap但起初它告诉我我没有cl.exe所以我下载了 visual studio C++ 包,现在它显示了这个错误

 error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.14.26428\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2

I never coded with C++ so I'm not sure what the error is.我从来没有用 C++ 编码,所以我不确定错误是什么。 I downloaded the CLI tools for C++ too and I don't think it's because the cl.exe isn't in the path since it found it.我也为 C++ 下载了 CLI 工具,但我不认为这是因为cl.exe在找到它后不在路径中。 Any insights??任何见解?

https://go.microsoft.com/fwlink/?LinkId=691126使用默认选择安装 Visual C++ 2015 Build Tools。

此错误似乎没有有效的解决方案,但一种解决方法是从https://www.lfd.uci.edu/~gohlke/pythonlibs/#python-ldap安装 Windows 二进制包

In my case, I had to copy or link (using link shell extension ) the x64 version of "C Connector" to the x86 folder.就我而言,我必须将 x64 版本的“C 连接器”复制或链接(使用链接外壳扩展)到 x86 文件夹。

If you can't find the x64 C connector...如果找不到 x64 C 连接器...

  1. Download mysql-installer-web-community-8.0.12.0.msi from their website: https://dev.mysql.com/downloads/installer/从他们的网站下载mysql-installer-web-community-8.0.12.0.msihttps : mysql-installer-web-community-8.0.12.0.msi
  2. Run the Installer, and click the Add button on the right, then locate the Connector C 6.1 x64运行安装程序,然后单击右侧的Add按钮,然后找到Connector C 6.1 x64

The C++ Connector has C compatible header files, but hard-linking to it does not work, as explained here: https://dev.mysql.com/downloads/connector/c/ C++ 连接器具有与 C 兼容的头文件,但硬链接到它不起作用,如下所述: https : //dev.mysql.com/downloads/connector/c/

You cannot install the x86 version alongside the x64 version.您不能在 x64 版本的同时安装 x86 版本。 The installer does not permit this.安装程序不允许这样做。

Otherwise, Hard-Link the x64 version否则,硬链接 x64 版本

  1. Install link shell extension .安装链接外壳扩展
  2. Navigate to "C:\\Program Files\\MySQL\\" then right click on "MySQL Connector C 6.1" and click Pick Link Source导航到“C:\\Program Files\\MySQL\\”,然后右键单击“MySQL Connector C 6.1”并单击“ Pick Link Source
  3. Navigate to "C:\\Program Files (x86)\\MySQL\\" and Drop Link As... > Junction导航到“C:\\Program Files (x86)\\MySQL\\”并Drop Link As... > Junction
    • A Junction is a duplicate reference in the file system to a folder.结点是文件系统中对文件夹的重复引用。 Creating a second junction reclassifies the original folder a junction as well, but they are both authentic references to the same folder, and so, unlike symbolic links, they will work with scripts, because they are real, and are implemented on the file system level.创建第二个联结也将原始文件夹重新分类为联结,但它们都是对同一文件夹的真实引用,因此,与符号链接不同,它们将使用脚本,因为它们是真实的,并且在文件系统级别实现.
  4. Then, if the connector you have installed is a different version number and you want to try to force it to work with a non-compatible script, rename it to match the folder mentioned in the error message.然后,如果您安装的连接器的版本号不同,并且您想尝试强制它使用不兼容的脚本,请重命名它以匹配错误消息中提到的文件夹。 For example...例如...

    • C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.15.26726 \\bin\\HostX86\\x64\\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Dversion_info=(1,3,13,'final',0) -D__version__=1.3.13 "-I C:\\Program Files (x86)\\MySQL\\MySQL Connector C 6.1 \\include" "-Ic:\\program files\\python37\\include" "-Ic:\\program files\\python37\\include" "-IC:\\Program Files (x86)\\Microsoft Visu... C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX86\\x64\\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Dversion_info=(1,3,13,'final',0) -D__version__=1.3.13 "-I C:\\Program Files (x86)\\MySQL\\MySQL Connector C 6.1 \\include" "-Ic:\\program files \\python37\\include" "-Ic:\\program files\\python37\\include" "-IC:\\Program Files (x86)\\Microsoft Visu...

Crappy pip code failing to pass variables from the system environment :(糟糕的 pip 代码无法从系统环境中传递变量:(

I had a similar issue.我有一个类似的问题。

I had installed a 32-bit python interpreter from https://www.python.org/downloads/windows/ mistakenly in my 64-bit windows machine.我在我的 64 位 Windows 机器上错误地从https://www.python.org/downloads/windows/安装了一个 32 位 python 解释器。

Then I downloaded the correct 64-bit interpreter setup and installed it.然后我下载了正确的 64 位解释器设置并安装了它。 Then I pointed the Pycharm interpreter path to it.然后我将 Pycharm 解释器路径指向它。

Then my issue was solved.然后我的问题就解决了。 I hope this will help you...我希望这能帮到您...

I know this question was asked years ago, but for future users, I thought of providing an answer for this question.我知道这个问题是多年前提出的,但对于未来的用户,我想为这个问题提供一个答案。 Today I've faced the same problem with the "Microsoft visual studio 2019 build tool."今天,我在使用“Microsoft Visual Studio 2019 构建工具”时遇到了同样的问题。

error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30037\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2

I have come across this issue while trying to install the dependency through anaconda3 cmd in windows OS.我在 Windows 操作系统中尝试通过 anaconda3 cmd 安装依赖项时遇到了这个问题。

pip install sparse_dot_topn

I have tried different methods suggest in different portals and couldn't resolve this for hours.我在不同的门户中尝试了不同的方法建议,但几个小时都无法解决这个问题。 At the same time, I've ended up installing unnecessary components of the visual studio build tool as well.同时,我最终也安装了 Visual Studio 构建工具的不必要组件。 Finally, I found the problem is associated with the setup tool library, and the problem can be solved through force upgrade to the setup tool package最后发现问题与setup工具库有关,可以通过强制升级setup工具包解决问题

python -m pip install -U pip setuptools

When I was perusing the internet to find the solution I ran into an adjacent problem: Python was not found , which I solved by (assuming your python works and is added to PATH) going to Settings > Manage App Execution Aliases and turning off "python".当我仔细浏览互联网以找到解决方案时,我遇到了一个相邻的问题: 找不到 Python ,我通过(假设您的 Python 工作并已添加到 PATH)转到设置 > 管理应用程序执行别名并关闭“python ”。 They try installing your package again他们再次尝试安装您的软件包

Install the C++ build tools from here: https://my.visualstudio.com/Downloads从这里安装 C++ 构建工具: https : //my.visualstudio.com/Downloads

Search for 'build tools' and download the latest VS build tools installer.搜索“构建工具”并下载最新的 VS 构建工具安装程序。 Install the C++ build tools (currently it's called "Desktop Development with C++") with the defaults.使用默认值安装 C++ 构建工具(目前称为“使用 C++ 进行桌面开发”)。

What worked for me in the same situation: Except installing VS Build Tools, install whole Visual Studio.在相同情况下对我有用的方法:除了安装 VS Build Tools,安装整个 Visual Studio。 Python libs often require C/C++ compiler Python 库通常需要 C/C++ 编译器

I had the same error;我有同样的错误; although when installing lux-api虽然在安装lux-api

What worked for me was downgrading the default python version 3.10 -> 3.9 ( ref )对我有用的是降级默认的 python 版本 3.10 -> 3.9 ( ref )

ps the error that I had was the following ps我遇到的错误如下

  error: command ...\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe failed with exit code 2
  ----------------------------------------
  ERROR: Failed building wheel for pandas
Failed to build pandas
ERROR: Could not build wheels for pandas, which is required to install pyproject.toml-based projects

I had the similar issue.我有类似的问题。 I was trying to build pandas from source.我试图从源代码构建 pandas 。 I figured out that my build tools were not compatible with the source.我发现我的构建工具与源代码不兼容。 I had MSVC v142 installed.我安装了 MSVC v142。 So I installed the below components and this worked for me:所以我安装了以下组件,这对我有用:

  • Windows 10 SDK (10.0.17763.0) Windows 10 SDK (10.0.17763.0)
  • MSVC v141 - VS 2017 C++x64/x86 build tools MSVC v141 - VS 2017 C++x64/x86 构建工具

These tools can also be installed from cmd, just install visual studio 2019 build tools exe and then run this command in cmd as admin:这些工具也可以从 cmd 安装,只需安装 Visual Studio 2019 构建工具 exe,然后以管理员身份在 cmd 中运行此命令:

vs_buildtools.exe --quiet --wait --norestart --nocache ^
--installPath C:\BuildTools ^
--add "Microsoft.VisualStudio.Workload.VCTools;includeRecommended" ^
--add Microsoft.VisualStudio.Component.VC.v141 ^
--add Microsoft.VisualStudio.Component.VC.v141.x86.x64 ^
--add Microsoft.VisualStudio.Component.Windows10SDK.17763

I also had to install additional tools to make it work correctly:我还必须安装其他工具才能使其正常工作:

  • C++/CLI Support for v141 build tools (14.16) C++/CLI 支持 v141 构建工具 (14.16)

Once the tools were installed correctly then I had to initialize x64 environment with new installed build tools:正确安装工具后,我必须使用新安装的构建工具初始化 x64 环境:

"C:\BuildTools\VC\Auxiliary\Build\vcvars64.bat" -vcvars_ver=14.16 10.0.17763.0

After that I restarted my computer and build pandas again and it was build successfully.之后我重新启动计算机并再次构建 pandas 并成功构建。

I had a similar issue.我有一个类似的问题。 Install older version of python and this problem will be solved.安装旧版本的 python 即可解决此问题。 I hope this will help you.我希望这能帮到您。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio 2017 找不到 cl.exe - Visual Studio 2017 failed to locate cl.exe 错误PRJ0002:从'C:\\ Program Files \\ Microsoft Visual Studio 9.0 \\ VC \\ bin \\ cl.exe'返回错误结果-1073741515 - error PRJ0002 : Error result -1073741515 returned from 'C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\cl.exe' 安装构建工具后找不到 Visual Studio Code MSVC cl.exe - Visual Studio Code MSVC cl.exe not found after installing build tools Visual Studio 2017 'C:\\OpenCV-3.3.0\\opencv\\build\\x64\\vc14\\bin\\opencv_world330d.dll'。 无法找到或打开 PDB 文件 - Visual Studio 2017 'C:\OpenCV-3.3.0\opencv\build\x64\vc14\bin\opencv_world330d.dll'. Cannot find or open the PDB file Visual Studio 2017 - 错误MSB6006:“CL.exe”退出代码2 - Visual studio 2017 - error MSB6006: “CL.exe” exited with code 2 为 cl.exe (Visual Studio Code) 指定命令行 C++ 版本 - Specify command-line C++ version for cl.exe (Visual Studio Code) 如何使用从 cl.exe(Visual Studio C/C++ 编译器)生成的 a.exe 从命令行调试 a.exe? - How can I debug a .exe from the command line with a .exe generated from cl.exe (Visual Studio C/C++ Compiler)? 编译Visual Studio C ++项目时出错-cl.exe错误 - Error compiling Visual Studio C++ project - error with cl.exe 在Visual Studio C ++中编译时出现错误2,代码退出MSB6006“ CL.exe” - Error MSB6006 “CL.exe” exited with code 2 in compile in visual studio c++ 如何修复错误:命令“x86_64-linux-gnu-gcc”失败,退出状态为 1 - How to fix error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM