I\'ve installed Python 3.5 and while running
pip install mysql-python
it gives me the following error
error: Microsoft Vi
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
had a similar situation installing pymssql
pip was trying to build the package because there were no official wheels
for python 3.6 & windows.
solved it by downloading an unoffical wheel from here:
http://www.lfd.uci.edu/~gohlke/pythonlibs/
specifically for your case -> http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python
Just go to https://www.lfd.uci.edu/~gohlke/pythonlibs/ find your suitable package (whl file). Download it. Go to the download folder in cmd or typing 'cmd' on the address bar of the folder. Run the command :
pip install mysqlclient-1.4.6-cp38-cp38-win32.whl
(Type the file name correctly. I have given an example only). Your problem will be solved without installing build toll cpp of 6GB size.
To expand on the answers by ocean800, davidsheldon and user3661384:
You should now no longer use Visual Studio Tools 2015 since a newer version is available. As indicated by the Python documentation you should be using Visual Studio Tools 2017 instead.
Visual C++ Build Tools 2015 was upgraded by Microsoft to Build Tools for Visual Studio 2017.
Download it from here
You will require also need setuptools
, if you don't have setup tools run:
pip install setuptools
Or if you already have it, be sure to upgrade it.
pip install setuptools --upgrade
For the Python documentation link above you will see that setuptools version must be at least 34.4.0. for VS Tools to work
I had exactly the same issue and solved it by installing mysql-connector-python with:
pip install mysql-connector-python
I am on python3.7 & windows 10 and installing Microsoft Build Tools for Visual Studio 2017 (as described here) did not solve my problem that was identical to yours.
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