I\'ve installed Python 3.5 and while running
pip install mysql-python
it gives me the following error
error: Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat)
I have added the following lines to my Path
C:\\Program Files\\Python 3.5\\Scripts\\;
C:\\Program Files\\Python 3.5\\;
C:\\Windows\\System32;
C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC;
C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\VC
I have a 64bit win 7 setup in my PC.
What could be the solution for mitigating this error and installing the modules correctly via pip
.
Your path only lists Visual Studio 11 and 12, it wants 14, which is Visual Studio 2015. If you install that, and remember to tick the box for Languages->C++
then it should work.
On my Python 3.5 install, the error message was a little more useful, and included the URL to get it from
error: Microsoft Visual C++ 14.0 is required. Get it with \"Microsoft Visual C++ Build Tools\": http://landinghub.visualstudio.com/visual-cpp-build-tools
Edit: New working link
Edit: As suggested by Lightfire228, you may also need to upgrade setuptools
package for the error to disappear:
pip install --upgrade setuptools
To solve any of the following errors:
Failed building wheel for misaka
Failed to build misaka
Microsoft Visual C++ 14.0 is required
Unable to find vcvarsall.bat
The Solution is:
Go to Build Tools for Visual Studio 2017
Select free download under Visual Studio Community 2017. This will download the installer. Run the installer.
Select what you need under workload tab:
a. Under Windows, there are 3 choices. Only check Desktop development with C++
b. Under Web & Cloud, there are 7 choices. Only check Python development (I believe this is optional But I have done it).
In cmd, type pip3 install misaka
Note if you already installed Visual Studio then when you run the installer, you can modify yours (click modify button under Visual Studio Community 2017) and do steps 3 and 4
Final Note : If you don\'t want to install all modules, having the 3 ones below (or a newer version of the VC++ 2017) would be sufficient. (you can also install the Visual Studio Build Tools with only these options so you dont need to install Visual Studio Community Edition itself) => This minimal install is already a 4.5GB, so saving off anything is helpful
As the other responses pointed out, one solution is to install Visual Studio 2015. However, it takes a few GBs of disk space. One way around is to install precompiled binaries. The webpage http://www.lfd.uci.edu/~gohlke/pythonlibs (mirror) contains precompiled binaries for many Python packages. After downloading the package of interest to you, you can install it using pip install
, e.g. pip install mysqlclient‑1.3.10‑cp35‑cp35m‑win_amd64.whl
.
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.
I had the exact issue while trying to install Scrapy web scraping Python framework on my Windows 10 machine. I figured out the solution this way:
Download the latest (the last one) wheel file from this link