Error installing mysql-python

3

I'm trying to install the pip module with mysql-python in a Windows 7 Professional.

The fact is that I'm getting this error:

C:\Users_027>pip install mysql-python
Collecting mysql-python
  Using cached MySQL-python-1.2.5.zip
Installing collected packages: mysql-python
  Running setup.py install for mysql-python ... error
    Complete output from command c:\users_027\appdata\local\programs\python\python35-32\python.exe -u -c "import setuptools, tokeniz
e;__file__='C:\Users\40_027\AppData\Local\Temp\pip-build-qjy4ksg8\mysql-python\setup.py';exec(compile(getattr(tokenize, 'open',
 open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users_027\AppData\Local\Temp\pip-mttq0w3y-rec
ord\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.5
    copying _mysql_exceptions.py -> build\lib.win32-3.5
    creating build\lib.win32-3.5\MySQLdb
    copying MySQLdb\__init__.py -> build\lib.win32-3.5\MySQLdb
    copying MySQLdb\converters.py -> build\lib.win32-3.5\MySQLdb
    copying MySQLdb\connections.py -> build\lib.win32-3.5\MySQLdb
    copying MySQLdb\cursors.py -> build\lib.win32-3.5\MySQLdb
    copying MySQLdb\release.py -> build\lib.win32-3.5\MySQLdb
    copying MySQLdb\times.py -> build\lib.win32-3.5\MySQLdb
    creating build\lib.win32-3.5\MySQLdb\constants
    copying MySQLdb\constants\__init__.py -> build\lib.win32-3.5\MySQLdb\constants
    copying MySQLdb\constants\CR.py -> build\lib.win32-3.5\MySQLdb\constants
    copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.5\MySQLdb\constants
    copying MySQLdb\constants\ER.py -> build\lib.win32-3.5\MySQLdb\constants
    copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.5\MySQLdb\constants
    copying MySQLdb\constants\REFRESH.py -> build\lib.win32-3.5\MySQLdb\constants
    copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.5\MySQLdb\constants
    running build_ext
    building '_mysql' extension
    **error: Unable to find vcvarsall.bat**

    ----------------------------------------
Command "c:\users_027\appdata\local\programs\python\python35-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\Users\4
0_027\AppData\Local\Temp\pip-build-qjy4ksg8\mysql-python\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().
replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users_027\AppData\Local\Temp\pip-mttq0w3y-record\install-record.txt -
-single-version-externally-managed --compile" failed with error code 1 in C:\Users_027\AppData\Local\Temp\pip-build-qjy4ksg8\mysql-p
ython\

I have tried several solutions that I have seen online, but nothing has worked for me. I have tried to remove Python and reinstall and neither.

Can you guide me a little with this topic?

    
asked by jandresplp 05.04.2016 в 09:54
source

2 answers

1

Because of the error it can be deduced that it is a compilation problem, you mentioned that you have tried several things but you have not said what they are.

What I recommend is that you install something like Visual Studio Express and try the installation again.

I know it sounds silly, but do not forget to have MySQL installed.

Alternatively, try easy_install to see how it goes.

    
answered by 05.04.2016 / 14:41
source
2

As @ César says, you need the compiler VC ++ . That the error says that it does not find vcvarsall.bat is the evidence that you do not have it installed.

If you do not want to complicate, do not use pip or easy_install in windows for modules that need compilation. Find the installer for mysql-python or, much better, use conda to install python packages on windows.

    
answered by 06.04.2016 в 10:19