Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat)

后端 未结 30 2191
谎友^
谎友^ 2020-11-21 07:34

I\'ve installed Python 3.5 and while running

pip install mysql-python

it gives me the following error

error: Microsoft Vi         


        
30条回答
  •  情深已故
    2020-11-21 08:15

    TLDR run vcvars64.bat

    After endlessly searching through similar questions with none of the solutions working. -Adding endless folders to my path and removing them. uninstalling and reinstalling visual studio commmunity and build tools. and step by step attempting to debug I finally found a solution that worked for me.

    (background notes if anyone is in a similar situation) I recently reset my main computer and after reinstalling the newest version of python (Python3.9) libraries I used to install with no troubles (main example pip install opencv-python) gave

    cl
        is not a full path and was not found in the PATH.
    

    after adding cl to the path from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\Hostx64\x64

    and several different windows kits one at a time getting the following.

    The C compiler
    
    "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe"
    
    is not able to compile a simple test program.
    

    with various link errors or " Run Build Command(s):jom /nologo cmTC_7c75e\fast && The system cannot find the file specified"

    upgrading setuptools and wheel from both a regular command line and an admin one did nothing as well as trying to manually download a wheel or trying to install with --only-binary :all:

    Finally the end result that worked for me was running the correct vcvars.bat for my python installation namely running "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" once (not vcvarsall or vcvars32) (because my python installed was 64 bit) and then running the regular command pip install opencv-python worked.

提交回复
热议问题