I have been trying to pip install MySQL-python
on Windows 7 but it returns unable to find vcvarsall.bat
. I am using Python 3.4. How can I make this work in a simple way without going through the thorny path of installing Visual Studio 2008?
2 Answers
As pip
is used to install from source code, it requires compilation. There are two options to resolve that:
Install using easy_install
easy_install
is quickly able to install using compiled exe file.
Install using pip
using wheel package format
This is my favorite solution.
You have to get the wheel package format first. Many Python packages have them already and latest version of pip
will by default install from it, older versions must be used with --use-wheel
switch.
If wheel does not exist, you shall create one. Install wheel
package first and use it to convert existing exe or egg file for given platform to wheel.
In case, there is no already compiled version for the package of your interest, there is no other solution than to compile it somewhere. Anyway, once you get it, you can turn into wheel format and install from it.
For further information about general pip
, easy_install
and wheel usage and setup see my other answer

- 1
- 1

- 42,725
- 12
- 101
- 98
-
1@Clocker I am happy it works for you. Anyway, whenever possible, prefer using pip as easy_install sometime does not allow safe uninstal as pip does. Ideal solution would be, if authors publish the exe converted to wheel format, but you can do so yourself (what is of course a bit more work, but with private pypi servers like `devpi-server` it is not so difficult). Enjoy Python. – Jan Vlcinsky Apr 07 '16 at 05:25
-
I ended up following the answer from the link you provided and converting the exe to whl -> worked well good findings sr – Clocker Apr 08 '16 at 16:19
Here is a great page with windows binaries to install a lot of common python packages.
Here is a link to the mysql-python downloads

- 31,030
- 3
- 31
- 50
-
Do you know what I should do specifically to solve this? What binary file should I download? – Yax Jul 16 '14 at 14:43
-
If you are using python2.7 on a 64-bit windows machine then you would download and run MySQL‑python‑1.2.5.win‑amd64‑py2.7.exe. For a 32-bit machine running python2.6 you would download and run MySQL‑python‑1.2.5.win32‑py2.6.exe – Iain Shelvington Jul 16 '14 at 14:50