2

I couldn't install the mysql package and have looked at many solutions but nothing solved the issue. Please help, and tell what I need to do to make this work.

After running the command, this was displayed:

Collecting mysql-python
Using cached MySQL-python-1.2.5.zip
Installing collected packages: mysql-python
Running setup.py install for mysql-python
Complete output from command "C:\Program Files (x86)\Python_3.4.3\python.exe
" -c "import setuptools, tokenize;__file__='C:\\Users\\RNN\\AppData\\Local\\Temp
\\pip-build-rauxmcb1\\mysql-python\\setup.py';exec(compile(getattr(tokenize, 'op
en', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install -
-record C:\Users\RNN\AppData\Local\Temp\pip-0cir5bet-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 -> build\lib.win32-3.4
creating build\lib.win32-3.4\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win32-3.4\MySQLdb
copying MySQLdb\converters.py -> build\lib.win32-3.4\MySQLdb
copying MySQLdb\connections.py -> build\lib.win32-3.4\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win32-3.4\MySQLdb
copying MySQLdb\release.py -> build\lib.win32-3.4\MySQLdb
copying MySQLdb\times.py -> build\lib.win32-3.4\MySQLdb
creating build\lib.win32-3.4\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win32-3.4\MySQLdb\constan
ts
copying MySQLdb\constants\CR.py -> build\lib.win32-3.4\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.4\MySQLdb\const
ants
copying MySQLdb\constants\ER.py -> build\lib.win32-3.4\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.4\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win32-3.4\MySQLdb\constant
s
copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.4\MySQLdb\constants

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:\Program F
iles (x86)\Python_3.4.3\include" "-IC:\Program Files (x86)\Python_3.4.3\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\\B
IN\\cl.exe' failed with exit status 2

Then this was in red:

Command ""C:\Program Files (x86)\Python_3.4.3\python.exe" -c "import setuptools,
 tokenize;__file__='C:\\Users\\RNN\\AppData\\Local\\Temp\\pip-build-rauxmcb1\\my
sql-python\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).rea
d().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\RNN\App
Data\Local\Temp\pip-0cir5bet-record\install-record.txt --single-version-external
ly-managed --compile" failed with error code 1 in C:\Users\RNN\AppData\Local\Tem
p\pip-build-rauxmcb1\mysql-python

3 Answers 3

3

All I had to do was go over to oracle, and download the MySQL Connector C 6.0.2 and do the typical install.

http://dev.mysql.com/downloads/connector/c/6.0.html#downloads

Once that was done, I went into pycharms, and selected the MySQL-python==1.2.4 package to install, and it worked great. No need to update any configuration or anything like that. This was the simplest version for me to work through.

Hope it helps.

Sign up to request clarification or add additional context in comments.

5 Comments

pycharms? should i install it?
And what is the use of a connector?
No you don't need pycharm for it. Just install the connector and then install mysql-python using pip. It should work.
MySQL Connector/ODBC (sometimes called just Connector ODBC or MyODBC) is a driver for connecting to a MySQL database server through the Open Database Connectivity (ODBC) application program interface (API), which is the standard means of connecting to any database.
Make sure you download the 32bit version of the connector. With the 32 bit connector, it will work with MySQL-python==1.2.5
2

On its pypi listing here, mysql db currently has support for python up to 2.7. There are other mysql packages though, see mysqlclient.

Comments

0

Installing the .exe setup from https://pypi.python.org/pypi/MySQL-python/1.2.5 worked for me.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.