Fail to installing MySQL - Python package

Answered

Collecting MySQL-Python
Using cached https://files.pythonhosted.org/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/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\..\pycharmprojects\retrieveinfo\venv\scripts\python.exe" -u -c "import setuptools, token
ize;__file__='C:\\Users\\..\\AppData\\Local\\Temp\\pip-install-c_j49jbz\\MySQL-Python\\setup.py';f=getattr(tokenize, 'open', open)(__fi
le__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\..\AppData\Local\T
emp\pip-record-bacpv1x_\install-record.txt --single-version-externally-managed --compile --install-headers "c:\users\..\pycharmproj
ects\retrieveinfo\venv\include\site\python3.7\MySQL-Python":
running install
running build
running build_py
creating build
creating build\lib.win32-3.7
copying _mysql_exceptions.py -> build\lib.win32-3.7
creating build\lib.win32-3.7\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\converters.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\connections.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\release.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\times.py -> build\lib.win32-3.7\MySQLdb
creating build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.7\MySQLdb\constants
running build_ext
building '_mysql' extension
creating build\temp.win32-3.7
creating build\temp.win32-3.7\Release
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.15.26726\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /D
NDEBUG /MD -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:\users\
..\pycharmprojects\retrieveinfo\venv\include" "-IC:\Users\..\AppData\Local\Programs\Python\Python37-32\include" "-IC:\Use
rs\..\AppData\Local\Programs\Python\Python37-32\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools
\MSVC\14.15.26726\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\includ
e\10.0.17134.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include
\10.0.17134.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.
0.17134.0\cppwinrt" /Tc_mysql.c /Fobuild\temp.win32-3.7\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\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX86\\x86\\cl.e
xe' failed with exit status 2

----------------------------------------
Command ""c:\users\..\pycharmprojects\retrieveinfo\venv\scripts\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\
\..\\AppData\\Local\\Temp\\pip-install-c_j49jbz\\MySQL-Python\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().repl
ace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\..\AppData\Local\Temp\pip-record-bacpv1x_\
install-record.txt --single-version-externally-managed --compile --install-headers "c:\users\..\pycharmprojects\retrieveinfo\venv\i
nclude\site\python3.7\MySQL-Python"" failed with error code 1 in C:\Users\..\AppData\Local\Temp\pip-install-c_j49jbz\MySQL-Python\

*the blank space is my private info

How to solve this problem to install the MySQL - Python package.

0
3 comments

Hi JackLim,

Thank you for contacting PyCharm support.

 

Please clarify how you tried to install MySQL-python package (from terminal or UI)?

Which python version you are using as project interpreter?

Kind regards,

Sergey

 

0
Avatar
Permanently deleted user

I using python version 3.7

I using both way to install the package

Both give me the same result.

  • error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2

 

0

As I can see from the documentation, it is not compatible with python 3.7 https://github.com/farcepest/MySQLdb1

Please correct me if I am missing something. (if so, please provide an output when trying to install it from PyCharm's UI and idea.log (Help | Show Log in...)).

Kind regards,

Sergey

https://www.jetbrains.com

The Drive to Develop

0

Please sign in to leave a comment.