Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

 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 ??

like image 621
UWGOOSE Avatar asked May 23 '18 17:05

UWGOOSE


People also ask

Where is MSVC compiler installed?

More precisely, the default path where you'll find the compiler is C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin .

Can I install Msvc without Visual Studio?

TL;DR: Yes, you can build from the command line without using or even installing the IDE.

Does Visual Studio use MSVC?

Microsoft C++ Compiler (MSVC)This is the default compiler for most Visual Studio C++ projects and is recommended if you are targeting Windows.

What is MSVC runtime?

The Visual C++ Redistributable installs Microsoft C and C++ (MSVC) runtime libraries. These libraries are required by many applications built by using Microsoft C and C++ tools.


3 Answers

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."

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.

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. 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

python -m pip install -U pip setuptools
like image 114
Nadeesha Thilakarathne Avatar answered Oct 19 '22 11:10

Nadeesha Thilakarathne


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

like image 43
UWGOOSE Avatar answered Oct 19 '22 10:10

UWGOOSE


Install Visual C++ 2015 Build Tools from https://go.microsoft.com/fwlink/?LinkId=691126 with default selection.

like image 7
ASHu2 Avatar answered Oct 19 '22 10:10

ASHu2