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

后端 未结 4 2438
离开以前
离开以前 2020-12-21 04:42

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

相关标签:
4条回答
  • 2020-12-21 05:01

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

    0 讨论(0)
  • 2020-12-21 05:11

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

    1. Download mysql-installer-web-community-8.0.12.0.msi from their website: https://dev.mysql.com/downloads/installer/
    2. 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

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

    Crappy pip code failing to pass variables from the system environment :(

    0 讨论(0)
  • 2020-12-21 05:14

    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

    0 讨论(0)
  • 2020-12-21 05:27

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

    0 讨论(0)
提交回复
热议问题