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

后端 未结 30 2176
谎友^
谎友^ 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 07:51

    Use the link to Visual C++ 2015 Build Tools. That will install Visual C++ 14.0 without installing Visual Studio.

    0 讨论(0)
  • 2020-11-21 07:51

    I was facing the same problem. The following worked for me: Download the unoffical binaries file from Christoph Gohlke installers site as per the python version installed on your system. Navigate to the folder where you have installed the file and run

    pip install filename
    

    For me python_ldap‑3.0.0‑cp35‑cp35m‑win_amd64.whl worked as my machine is 64 bit and python version is 3.5. This successfully installed python-ldap on my windows machine. You can try the same for mysql-python

    0 讨论(0)
  • 2020-11-21 07:53

    Binary install it the simple way!

    I can't believe no one has suggested this already - use the binary-only option for pip. For example, for mysqlclient:

    pip install --only-binary :all: mysqlclient
    

    Many packages don't create a build for every single release which forces your pip to build from source. If you're happy to use the latest pre-compiled binary version, use --only-binary :all: to allow pip to use an older binary version.

    0 讨论(0)
  • 2020-11-21 07:53

    I had the same issue. Downloading the Build Tools for Visual Studio 2017 worked for me. Find it here

    0 讨论(0)
  • 2020-11-21 07:53

    If Visual Studio is NOT your thing, and instead you are using VS Code, then this link will guide you thru the installer to get C++ running on your Windows.

    You only needs to complete the Pre-Requisites part. https://code.visualstudio.com/docs/cpp/config-msvc/#_prerequisites

    This is similar with other answers, but this link will probably age better than some of the responses here.

    PS: don't forget to run pip install --upgrade setuptools

    0 讨论(0)
  • 2020-11-21 07:53

    I had the same exact issue on my windows 10 python version 3.8. In my case, I needed to install mysqlclient were the error occurred Microsoft Visual C++ 14.0 is required. Because installing visual studio and it's packages could be a tedious process, Here's what I did:

    step 1 - Go to unofficial python binaries from any browser and open its website.

    step 2 - press ctrl+F and type whatever you want. In my case it was mysqlclient.

    step 3 - Go into it and choose according to your python version and windows system. In my case it was mysqlclient‑1.4.6‑cp38‑cp38‑win32.whl and download it.

    step 4 - open command prompt and specify the path where you downloaded your file. In my case it was C:\Users\user\Downloads

    step 5 - type pip install .\mysqlclient‑1.4.6‑cp38‑cp38‑win32.whl and press enter.

    Thus it was installed successfully, after which I went my project terminal re-entered the required command. This solved my problem

    Note that, while working on the project in pycharm, I also tried installing mysql-client from the project interpreter. But mysql-client and mysqlclient are different things. I have no idea why and it did not work.

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