添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

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

Ask Question

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

For me I didn't have the SDK installed when installing the C++ tools. Installing it from the C++ build tools fixed this. – wordsforthewise Jul 23, 2021 at 6:12 if you can provide your pc specs and windows version details, may be I can point you towards something more concrete – ASHu2 Feb 1, 2021 at 8:29

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

In my case, I had to copy or link (using link shell extension) the x64 version of "C Connector" to the x86 folder.

If you can't find the x64 C connector...

  • 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 the 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/

    You cannot install the x86 version alongside the x64 version. The installer does not permit this.

    Otherwise, Hard-Link the x64 version

  • 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...
  • Crappy pip code failing to pass variables from the system environment :(

    I had the similar issue. I was trying to build pandas from source. I figured out that my build tools were not compatible with the source. I had MSVC v142 installed. So I installed the below components and this worked for me:

  • Windows 10 SDK (10.0.17763.0)
  • MSVC v141 - VS 2017 C++x64/x86 build tools
  • 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:

    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)
  • Once the tools were installed correctly then I had to initialize x64 environment with new installed build tools:

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

    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.

    Then I downloaded the correct 64-bit interpreter setup and installed it. Then I pointed the Pycharm interpreter path to it.

    Then my issue was solved. I hope this will help you...

    I've the same issue: - src/spt_setup.c(23): warning C4273: '__p__environ' but I've Python 64bit: - Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 23:09:28) [MSC v.1916 64 bit (AMD64)] on win32 and I've - Visual Studio Builds tools 2019 with MS Visual C++ 2013, 2015-2019 On Windows 10Pro x64. – Stefano G. Dec 7, 2020 at 15:09

    I had the same error; although when installing lux-api

    What worked for me was downgrading the default python version 3.10 -> 3.9 (ref)

    p.s. the error that I had was the following

      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
            

    Thanks for contributing an answer to Stack Overflow!

    • Please be sure to answer the question. Provide details and share your research!

    But avoid

    • Asking for help, clarification, or responding to other answers.
    • Making statements based on opinion; back them up with references or personal experience.

    To learn more, see our tips on writing great answers.