Installing MySQL-python on windows 7
<p>Hey I tried installing MySQL-Pyhton for abut 5 hours now but keep getting an error. at first it was "Unable to find vcvarsall.bat" and some thing abut me needing to have visual C++ 2010 . so after looking around I found a "solution" for my problem ... only to receive a new error when I pip install MySQL-Pyhton.</p>

<p>I'm using python 3.4 with Pycharm The install is with pip on windows 7 .</p>

<p>This is what I get when I pip install </p>

<pre><code>&gt; Collecting MySQL-python
  Using cached MySQL-python-1.2.5.zip
Building wheels for collected packages: MySQL-python
  Running setup.py bdist_wheel for MySQL-python: started
  Running setup.py bdist_wheel for MySQL-python: finished with status 'error'
  Complete output from command C:\Python34\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\yuval\\AppData\\Local\\Temp\\pycharm-packaging0.tmp\\MySQL-python\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d C:\Users\yuval\AppData\Local\Temp\tmp_8v3yxijpip-wheel- --python-tag cp34:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win32-3.4
  copying _mysql_exceptions.py -&gt; build\lib.win32-3.4
  creating build\lib.win32-3.4\MySQLdb
  copying MySQLdb\__init__.py -&gt; build\lib.win32-3.4\MySQLdb
  copying MySQLdb\converters.py -&gt; build\lib.win32-3.4\MySQLdb
  copying MySQLdb\connections.py -&gt; build\lib.win32-3.4\MySQLdb
  copying MySQLdb\cursors.py -&gt; build\lib.win32-3.4\MySQLdb
  copying MySQLdb\release.py -&gt; build\lib.win32-3.4\MySQLdb
  copying MySQLdb\times.py -&gt; build\lib.win32-3.4\MySQLdb
  creating build\lib.win32-3.4\MySQLdb\constants
  copying MySQLdb\constants\__init__.py -&gt; build\lib.win32-3.4\MySQLdb\constants
  copying MySQLdb\constants\CR.py -&gt; build\lib.win32-3.4\MySQLdb\constants
  copying MySQLdb\constants\FIELD_TYPE.py -&gt; build\lib.win32-3.4\MySQLdb\constants
  copying MySQLdb\constants\ER.py -&gt; build\lib.win32-3.4\MySQLdb\constants
  copying MySQLdb\constants\FLAG.py -&gt; build\lib.win32-3.4\MySQLdb\constants
  copying MySQLdb\constants\REFRESH.py -&gt; build\lib.win32-3.4\MySQLdb\constants
  copying MySQLdb\constants\CLIENT.py -&gt; build\lib.win32-3.4\MySQLdb\constants
  warning: build_py: byte-compiling is disabled, skipping.

  running build_ext
  building '_mysql' extension
  creating build\temp.win32-3.4
  creating build\temp.win32-3.4\Release
  C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include" -IC:\Python34\include -IC:\Python34\include /Tc_mysql.c /Fobuild\temp.win32-3.4\Release\_mysql.obj /Zl
  _mysql.c
  _mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN\\cl.exe' failed with exit status 2

  ----------------------------------------
  Running setup.py clean for MySQL-python
Failed to build MySQL-python
Installing collected packages: MySQL-python
  Running setup.py install for MySQL-python: started
    Running setup.py install for MySQL-python: finished with status 'error'
    Complete output from command C:\Python34\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\yuval\\AppData\\Local\\Temp\\pycharm-packaging0.tmp\\MySQL-python\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\yuval\AppData\Local\Temp\pip-hqm_a4jr-record\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.4
    copying _mysql_exceptions.py -&gt; build\lib.win32-3.4
    creating build\lib.win32-3.4\MySQLdb
    copying MySQLdb\__init__.py -&gt; build\lib.win32-3.4\MySQLdb
    copying MySQLdb\converters.py -&gt; build\lib.win32-3.4\MySQLdb
    copying MySQLdb\connections.py -&gt; build\lib.win32-3.4\MySQLdb
    copying MySQLdb\cursors.py -&gt; build\lib.win32-3.4\MySQLdb
    copying MySQLdb\release.py -&gt; build\lib.win32-3.4\MySQLdb
    copying MySQLdb\times.py -&gt; build\lib.win32-3.4\MySQLdb
    creating build\lib.win32-3.4\MySQLdb\constants
    copying MySQLdb\constants\__init__.py -&gt; build\lib.win32-3.4\MySQLdb\constants
    copying MySQLdb\constants\CR.py -&gt; build\lib.win32-3.4\MySQLdb\constants
    copying MySQLdb\constants\FIELD_TYPE.py -&gt; build\lib.win32-3.4\MySQLdb\constants
    copying MySQLdb\constants\ER.py -&gt; build\lib.win32-3.4\MySQLdb\constants
    copying MySQLdb\constants\FLAG.py -&gt; build\lib.win32-3.4\MySQLdb\constants
    copying MySQLdb\constants\REFRESH.py -&gt; build\lib.win32-3.4\MySQLdb\constants
    copying MySQLdb\constants\CLIENT.py -&gt; build\lib.win32-3.4\MySQLdb\constants
    warning: build_py: byte-compiling is disabled, skipping.

    running build_ext
    building '_mysql' extension
    creating build\temp.win32-3.4
    creating build\temp.win32-3.4\Release
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\include" -IC:\Python34\include -IC:\Python34\include /Tc_mysql.c /Fobuild\temp.win32-3.4\Release\_mysql.obj /Zl
    _mysql.c
    _mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\BIN\\cl.exe' failed with exit status 2

    ----------------------------------------

  Failed building wheel for MySQL-python
Command "C:\Python34\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\yuval\\AppData\\Local\\Temp\\pycharm-packaging0.tmp\\MySQL-python\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\yuval\AppData\Local\Temp\pip-hqm_a4jr-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\yuval\AppData\Local\Temp\pycharm-packaging0.tmp\MySQL-python\
</code></pre>

<p>you're going to want to add Python to your Path Environment Variable in this way. Go to:</p>

<ol>
<li>My Computer</li>
<li>System Properties</li>
<li>Advanced System Settings</li>
<li>Under the "Advanced" tab click the button that says "Environment Variables"</li>
<li>Then under System Variables you are going to want to add / change the following variables: <strong>PYTHONPATH</strong> and <strong>Path</strong>. Here is a paste of what my variables look like:</li>
</ol>

<p><strong>PYTHONPATH</strong></p>

<pre><code>C:\Python27;C:\Python27\Lib\site-packages;C:\Python27\Lib;C:\Python27\DLLs;C:\Python27\Lib\lib-tk;C:\Python27\Scripts
</code></pre>

<p><strong>Path</strong></p>

<pre><code>C:\Program Files\MySQL\MySQL Utilities 1.3.5\;C:\Python27;C:\Python27\Lib\site-packages;C:\Python27\Lib;C:\Python27\DLLs;C:\Python27\Lib\lib-tk;C:\Python27\Scripts
</code></pre>

<p>Your Path's might be different, so please adjust them, but this configuration works for me and you should be able to run MySQL after making these changes.</p>

python mysql python-3.x