错误:命令“C:\\ Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.14.26428\\bin\\HostX86\\x64\\cl.exe”失败,退出状态为 2
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/50494411/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
error: command 'C:\\ Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.14.26428\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
提问by UWGOOSE
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
嗨,所以我试图pip install python-ldap
使用我的 git bash,但起初它告诉我我没有,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. 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. Any insights ??
我从来没有用 C++ 编码,所以我不确定错误是什么。我也下载了 C++ 的 CLI 工具,我认为这cl.exe
不是因为它在找到它后不在路径中。任何见解?
回答by UWGOOSE
There doesn't seem to be a valid solution for this error but one workaround is to install the windows binary package from https://www.lfd.uci.edu/~gohlke/pythonlibs/#python-ldap
似乎没有针对此错误的有效解决方案,但一种解决方法是从https://www.lfd.uci.edu/~gohlke/pythonlibs/#python-ldap安装 Windows 二进制包
回答by Ryan
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 连接器...
- Download
mysql-installer-web-community-8.0.12.0.msi
from their website: https://dev.mysql.com/downloads/installer/ - Run the Installer, and click the
Add
button on the right, then locate theConnector C 6.1 x64
mysql-installer-web-community-8.0.12.0.msi
从他们的网站下载:https: //dev.mysql.com/downloads/installer/- 运行安装程序,然后单击
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. The installer does not permit this.
您不能在 x64 版本的同时安装 x86 版本。安装程序不允许这样做。
Otherwise, Hard-Link the x64 version
否则,硬链接 x64 版本
- Install link shell extension.
- Navigate to "C:\Program Files\MySQL\" then right click on "MySQL Connector C 6.1" and click
Pick Link Source
- Navigate to "C:\Program Files (x86)\MySQL\" and
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.
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\MySQL\”,然后右键单击“MySQL Connector C 6.1”并单击
Pick Link Source
- 导航到“C:\Program Files (x86)\MySQL\”和
Drop Link As...
>Junction
- 结点是文件系统中对文件夹的重复引用。创建第二个联结也将原始文件夹重新分类为联结,但它们都是对同一文件夹的真实引用,因此,与符号链接不同,它们将使用脚本,因为它们是真实的,并且在文件系统级别实现.
然后,如果您安装的连接器的版本号不同,并且您想尝试强制它使用不兼容的脚本,请重命名它以匹配错误消息中提到的文件夹。例如...
- 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\包括""-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
Crappy pip code failing to pass variables from the system environment :(
糟糕的 pip 代码无法从系统环境中传递变量:(
回答by ASHu2
Install Visual C++ 2015 Build Tools from https://go.microsoft.com/fwlink/?LinkId=691126with default selection.
从https://go.microsoft.com/fwlink/?LinkId=691126使用默认选择安装 Visual C++ 2015 Build Tools 。
回答by Yasiru
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. Then I pointed the Pycharm interpreter path to it.
然后我下载了正确的 64 位解释器设置并安装了它。然后我将 Pycharm 解释器路径指向它。
Then my issue was solved. I hope this will help you...
然后我的问题就解决了。我希望这能帮到您...