Unable to install pattern - python

I am unable to install pattern library using
pip install pattern
I am getting the following error regarding mysqlclient. Initially I was getting error on Visual Studio which I resolved following the thread
Failed building wheel for mysqlclient
Running setup.py clean for mysqlclient
Failed to build mysqlclient
Installing collected packages: python-docx, mysqlclient, beautifulsoup4, pattern
Running setup.py install for mysqlclient ... error
Complete output from command c:\users\ashis.mohanty\appdata\local\programs\python\python37\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\ASHIS~1.MOH\\AppData\\Local\\Temp\\pip-install-e2m7rr0s\\mysqlclient\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\ASHIS~1.MOH\AppData\Local\Temp\pip-record-7_2in4ff\install-record.txt --single-version-externally-managed --compile:
c:\users\ashis.mohanty\appdata\local\programs\python\python37\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'long_description_content_type'
warnings.warn(msg)
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
copying _mysql_exceptions.py -> build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\compat.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\connections.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\converters.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\release.py -> build\lib.win-amd64-3.7\MySQLdb
copying MySQLdb\times.py -> build\lib.win-amd64-3.7\MySQLdb
creating build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-3.7\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win-amd64-3.7\MySQLdb\constants
running build_ext
building '_mysql' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Dversion_info=(1,3,13,'final',0) -D__version__=1.3.13 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.1\include" -Ic:\users\ashis.mohanty\appdata\local\programs\python\python37\include -Ic:\users\ashis.mohanty\appdata\local\programs\python\python37\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\include" "-IC:\Program Files (x86)\Windows Kits\10\include\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.win-amd64-3.7\Release\_mysql.obj /Zl
_mysql.c
_mysql.c(29): fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
Command
"c:\users\ashis.mohanty\appdata\local\programs\python\python37\python.exe
-u -c "import setuptools, tokenize;__file__='C:\\Users\\ASHIS~1.MOH\\AppData\\Local\\Temp\\pip-install-e2m7rr0s\\mysqlclient\\setup.py';f=getattr(tokenize,
'open', open)(__file__);code=f.read().replace('\r\n',
'\n');f.close();exec(compile(code, __file__, 'exec'))" install
--record C:\Users\ASHIS~1.MOH\AppData\Local\Temp\pip-record-7_2in4ff\install-record.txt
--single-version-externally-managed --compile" failed with error code 1 in
C:\Users\ASHIS~1.MOH\AppData\Local\Temp\pip-install-e2m7rr0s\mysqlclient\

There my be some problem(or configurations needed) in Microsoft Visual C++....Try to Install Visual C++ with Microsoft Build Tools.

Related

Error when trying to Install Web3 using Python

Trying to install web3 in Python with the pip install command, it gets to Running setup.py install for cytoolz and then fails as follows:
I have searched many articles that suggest installing the Microsoft Visual C++ 14.0 using the Build Tools for Visual Studio, which I have done.
I have also copied the rc.exe and rc.dll from the C:\Program Files (x86)\Windows Kits\10\bin\x86 to the C:\Program Files (x86)\Microsoft Visual Studio folder.
None of these seem to have worked unfortunately.
I tried to install cytoolz on its own but it gives the same error below.
ERROR: Command errored out with exit status 1:
command: 'c:\users\mcbai\appdata\local\programs\python\python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\mcbai\\AppData\\Local\\Temp\\pip-install-745dmcik\\cytoolz_2a8cbc08ed71439fb6f4b92d63b43a98\\setup.py'"'"'; __file__='"'"'C:\\Users\\mcbai\\AppData\\Local\\Temp\\pip-install-745dmcik\\cytoolz_2a8cbc08ed71439fb6f4b92d63b43a98\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\mcbai\AppData\Local\Temp\pip-record-tgqd_7wt\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\mcbai\AppData\Local\Programs\Python\Python39\Include\cytoolz'
cwd: C:\Users\mcbai\AppData\Local\Temp\pip-install-745dmcik\cytoolz_2a8cbc08ed71439fb6f4b92d63b43a98\
Complete output (65 lines):
[1/5] Cythonizing cytoolz/utils.pyx
[2/5] Cythonizing cytoolz/dicttoolz.pyx
[3/5] Cythonizing cytoolz/functoolz.pyx
[4/5] Cythonizing cytoolz/itertoolz.pyx
[5/5] Cythonizing cytoolz/recipes.pyx
running install
C:\Users\mcbai\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\cytoolz
copying cytoolz\compatibility.py -> build\lib.win-amd64-3.9\cytoolz
copying cytoolz\_signatures.py -> build\lib.win-amd64-3.9\cytoolz
copying cytoolz\_version.py -> build\lib.win-amd64-3.9\cytoolz
copying cytoolz\__init__.py -> build\lib.win-amd64-3.9\cytoolz
creating build\lib.win-amd64-3.9\cytoolz\curried
copying cytoolz\curried\exceptions.py -> build\lib.win-amd64-3.9\cytoolz\curried
copying cytoolz\curried\operator.py -> build\lib.win-amd64-3.9\cytoolz\curried
copying cytoolz\curried\__init__.py -> build\lib.win-amd64-3.9\cytoolz\curried
copying cytoolz\dicttoolz.pyx -> build\lib.win-amd64-3.9\cytoolz
copying cytoolz\functoolz.pyx -> build\lib.win-amd64-3.9\cytoolz
copying cytoolz\itertoolz.pyx -> build\lib.win-amd64-3.9\cytoolz
copying cytoolz\recipes.pyx -> build\lib.win-amd64-3.9\cytoolz
copying cytoolz\utils.pyx -> build\lib.win-amd64-3.9\cytoolz
copying cytoolz\cpython.pxd -> build\lib.win-amd64-3.9\cytoolz
copying cytoolz\dicttoolz.pxd -> build\lib.win-amd64-3.9\cytoolz
copying cytoolz\functoolz.pxd -> build\lib.win-amd64-3.9\cytoolz
copying cytoolz\itertoolz.pxd -> build\lib.win-amd64-3.9\cytoolz
copying cytoolz\recipes.pxd -> build\lib.win-amd64-3.9\cytoolz
copying cytoolz\utils.pxd -> build\lib.win-amd64-3.9\cytoolz
copying cytoolz\__init__.pxd -> build\lib.win-amd64-3.9\cytoolz
creating build\lib.win-amd64-3.9\cytoolz\tests
copying cytoolz\tests\dev_skip_test.py -> build\lib.win-amd64-3.9\cytoolz\tests
copying cytoolz\tests\test_compatibility.py -> build\lib.win-amd64-3.9\cytoolz\tests
copying cytoolz\tests\test_curried.py -> build\lib.win-amd64-3.9\cytoolz\tests
copying cytoolz\tests\test_curried_toolzlike.py -> build\lib.win-amd64-3.9\cytoolz\tests
copying cytoolz\tests\test_dev_skip_test.py -> build\lib.win-amd64-3.9\cytoolz\tests
copying cytoolz\tests\test_dicttoolz.py -> build\lib.win-amd64-3.9\cytoolz\tests
copying cytoolz\tests\test_docstrings.py -> build\lib.win-amd64-3.9\cytoolz\tests
copying cytoolz\tests\test_doctests.py -> build\lib.win-amd64-3.9\cytoolz\tests
copying cytoolz\tests\test_embedded_sigs.py -> build\lib.win-amd64-3.9\cytoolz\tests
copying cytoolz\tests\test_functoolz.py -> build\lib.win-amd64-3.9\cytoolz\tests
copying cytoolz\tests\test_inspect_args.py -> build\lib.win-amd64-3.9\cytoolz\tests
copying cytoolz\tests\test_itertoolz.py -> build\lib.win-amd64-3.9\cytoolz\tests
copying cytoolz\tests\test_none_safe.py -> build\lib.win-amd64-3.9\cytoolz\tests
copying cytoolz\tests\test_recipes.py -> build\lib.win-amd64-3.9\cytoolz\tests
copying cytoolz\tests\test_serialization.py -> build\lib.win-amd64-3.9\cytoolz\tests
copying cytoolz\tests\test_signatures.py -> build\lib.win-amd64-3.9\cytoolz\tests
copying cytoolz\tests\test_tlz.py -> build\lib.win-amd64-3.9\cytoolz\tests
copying cytoolz\tests\test_utils.py -> build\lib.win-amd64-3.9\cytoolz\tests
running build_ext
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\Release
creating build\temp.win-amd64-3.9\Release\cytoolz
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\mcbai\AppData\Local\Programs\Python\Python39\include -IC:\Users\mcbai\AppData\Local\Programs\Python\Python39\Include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\winrt" /Tccytoolz/dicttoolz.c /Fobuild\temp.win-amd64-3.9\Release\cytoolz/dicttoolz.obj dicttoolz.c
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe" /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Users\mcbai\AppData\Local\Programs\Python\Python39\libs /LIBPATH:C:\Users\mcbai\AppData\Local\Programs\Python\Python39 /LIBPATH:C:\Users\mcbai\AppData\Local\Programs\Python\Python39\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.22000.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.22000.0\um\x64" /EXPORT:PyInit_dicttoolz build\temp.win-amd64-3.9\Release\cytoolz/dicttoolz.obj /OUT:build\lib.win-amd64-3.9\cytoolz\dicttoolz.cp39-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.9\Release\cytoolz\dicttoolz.cp39-win_amd64.lib
dicttoolz.obj : warning LNK4197: export 'PyInit_dicttoolz' specified multiple times; using first specification
Creating library build\temp.win-amd64-3.9\Release\cytoolz\dicttoolz.cp39-win_amd64.lib and object build\temp.win-amd64-3.9\Release\cytoolz\dicttoolz.cp39-win_amd64.exp
Generating code
Finished generating code
LINK : fatal error LNK1327: failure during running rc.exe
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link.exe' failed with exit code 1327
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\mcbai\appdata\local\programs\python\python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\mcbai\\AppData\\Local\\Temp\\pip-install-745dmcik\\cytoolz_2a8cbc08ed71439fb6f4b92d63b43a98\\setup.py'"'"'; __file__='"'"'C:\\Users\\mcbai\\AppData\\Local\\Temp\\pip-install-745dmcik\\cytoolz_2a8cbc08ed71439fb6f4b92d63b43a98\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\mcbai\AppData\Local\Temp\pip-record-tgqd_7wt\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\mcbai\AppData\Local\Programs\Python\Python39\Include\cytoolz' Check the logs for full command output.
Resolved: I removed anything Visual Studio related as well as build tools, reloaded VS and then installed the following build tools as per this article: https://stackoverflow.com/a/55575792/1612432

Pip install flask_mysqldb getting error: ERROR: Command errored out with exit status 1:

I am working at the moment to make an application. I want to make a connection to my database by using flask_mysqldb. I am making my environment in Flask. But when I try to download flask_mysqldb I am getting a long weird error. I searched on the internet for this problem but didn't seem to find any solutions. Or any problems like mine. The command that I use to install flask_mysqldb is :
pip install flask_mysqldb
This is the error that i am getting:
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Gebruiker\Envs\ticketsystem\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Gebruiker\\AppData\\Local\\Temp\\pip-install-pw1dam8u\\mysqlclient\\setup.py'"'"'; __file__='"'"'C:\\Users\\Gebruiker\\AppData\\Local\\Temp\\pip-install-pw1dam8u\\mysqlclient\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Gebruiker\AppData\Local\Temp\pip-wheel-8qolbr5n'
cwd: C:\Users\Gebruiker\AppData\Local\Temp\pip-install-pw1dam8u\mysqlclient\
Complete output (30 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win32-3.8
creating build\lib.win32-3.8\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\_exceptions.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\compat.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\connections.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\converters.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\release.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\times.py -> build\lib.win32-3.8\MySQLdb
creating build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.8\MySQLdb\constants
running build_ext
building 'MySQLdb._mysql' extension
creating build\temp.win32-3.8
creating build\temp.win32-3.8\Release
creating build\temp.win32-3.8\Release\MySQLdb
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Dversion_info=(1,4,6,'final',0) -D__version__=1.4.6 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.1\include\mariadb" -IC:\Users\Gebruiker\Envs\ticketsystem\include -Ic:\users\gebruiker\appdata\local\programs\python\python38-32\include -Ic:\users\gebruiker\appdata\local\programs\python\python38-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /TcMySQLdb/_mysql.c /Fobuild\temp.win32-3.8\Release\MySQLdb/_mysql.obj /Zl /D_CRT_SECURE_NO_WARNINGS
_mysql.c
MySQLdb/_mysql.c(29): fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.25.28610\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Failed building wheel for mysqlclient
Running setup.py clean for mysqlclient
Failed to build mysqlclient
Installing collected packages: mysqlclient, flask-mysqldb
Running setup.py install for mysqlclient ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Gebruiker\Envs\ticketsystem\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Gebruiker\\AppData\\Local\\Temp\\pip-install-pw1dam8u\\mysqlclient\\setup.py'"'"'; __file__='"'"'C:\\Users\\Gebruiker\\AppData\\Local\\Temp\\pip-install-pw1dam8u\\mysqlclient\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Gebruiker\AppData\Local\Temp\pip-record-5dfqjh2g\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Gebruiker\Envs\ticketsystem\include\site\python3.8\mysqlclient'
cwd: C:\Users\Gebruiker\AppData\Local\Temp\pip-install-pw1dam8u\mysqlclient\
Complete output (30 lines):
running install
running build
running build_py
creating build
creating build\lib.win32-3.8
creating build\lib.win32-3.8\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\_exceptions.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\compat.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\connections.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\converters.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\release.py -> build\lib.win32-3.8\MySQLdb
copying MySQLdb\times.py -> build\lib.win32-3.8\MySQLdb
creating build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.8\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.8\MySQLdb\constants
running build_ext
building 'MySQLdb._mysql' extension
creating build\temp.win32-3.8
creating build\temp.win32-3.8\Release
creating build\temp.win32-3.8\Release\MySQLdb
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Dversion_info=(1,4,6,'final',0) -D__version__=1.4.6 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.1\include\mariadb" -IC:\Users\Gebruiker\Envs\ticketsystem\include -Ic:\users\gebruiker\appdata\local\programs\python\python38-32\include -Ic:\users\gebruiker\appdata\local\programs\python\python38-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /TcMySQLdb/_mysql.c /Fobuild\temp.win32-3.8\Release\MySQLdb/_mysql.obj /Zl /D_CRT_SECURE_NO_WARNINGS
_mysql.c
MySQLdb/_mysql.c(29): fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.25.28610\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\Gebruiker\Envs\ticketsystem\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Gebruiker\\AppData\\Local\\Temp\\pip-install-pw1dam8u\\mysqlclient\\setup.py'"'"'; __file__='"'"'C:\\Users\\Gebruiker\\AppData\\Local\\Temp\\pip-install-pw1dam8u\\mysqlclient\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Gebruiker\AppData\Local\Temp\pip-record-5dfqjh2g\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Gebruiker\Envs\ticketsystem\include\site\python3.8\mysqlclient' Check the logs for full command output.
I am on Windows 10.
Flask_mysqldb depends on mysqlclient-python which says this about installing on Windows:
Building mysqlclient on Windows is very hard. But there are some binary wheels you can install easily.
Here's the list of wheels for the current version:
https://pypi.org/project/mysqlclient/1.4.6/#files
You can download the one that fits your platform and then install with pip install filename.whl Then you should be able to install flask_mysqldb without that error.

Why do I get an error when I run pip install MySQL-Python?

I am desperately trying to set up django, but I continuously run into problems.
When I run "pip install MySQL-python", I run into a wall of text in red and errors that is shown below. My problem is I cannot install django.
This is my first post on stack overflow, so please be easy on me if I messed up any formatting etc. I am not experienced in coding and the fact that I cannot even get basic stuff like this to work is extremely discouraging.
C:\WINDOWS\system32>pip install MySQL-python
Collecting MySQL-python
Using cached
https://files.pythonhosted.org/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip
Building wheels for collected packages: MySQL-python
Building wheel for MySQL-python (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\chrispa\appdata\local\programs\python\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Chrispa\\AppData\\Local\\Temp\\pip-install-ts0ir3mr\\MySQL-python\\setup.py'"'"'; __file__='"'"'C:\\Users\\Chrispa\\AppData\\Local\\Temp\\pip-install-ts0ir3mr\\MySQL-python\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Chrispa\AppData\Local\Temp\pip-wheel-4pjpg8hv' --python-tag cp37
cwd: C:\Users\Chrispa\AppData\Local\Temp\pip-install-ts0ir3mr\MySQL-python\
Complete output (29 lines):
running bdist_wheel
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\2019\Community\VC\Tools\MSVC\14.22.27905\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -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\chrispa\appdata\local\programs\python\python37-32\include -Ic:\users\chrispa\appdata\local\programs\python\python37-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.7.2\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.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\\2019\\Community\\VC\\Tools\\MSVC\\14.22.27905\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Failed building wheel for MySQL-python
Running setup.py clean for MySQL-python
Failed to build MySQL-python
Installing collected packages: MySQL-python
Running setup.py install for MySQL-python ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\chrispa\appdata\local\programs\python\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Chrispa\\AppData\\Local\\Temp\\pip-install-ts0ir3mr\\MySQL-python\\setup.py'"'"'; __file__='"'"'C:\\Users\\Chrispa\\AppData\\Local\\Temp\\pip-install-ts0ir3mr\\MySQL-python\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Chrispa\AppData\Local\Temp\pip-record-wedev03m\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\Chrispa\AppData\Local\Temp\pip-install-ts0ir3mr\MySQL-python\
Complete output (29 lines):
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\2019\Community\VC\Tools\MSVC\14.22.27905\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -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\chrispa\appdata\local\programs\python\python37-32\include -Ic:\users\chrispa\appdata\local\programs\python\python37-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.22.27905\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.7.2\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.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\\2019\\Community\\VC\\Tools\\MSVC\\14.22.27905\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\chrispa\appdata\local\programs\python\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Chrispa\\AppData\\Local\\Temp\\pip-install-ts0ir3mr\\MySQL-python\\setup.py'"'"'; __file__='"'"'C:\\Users\\Chrispa\\AppData\\Local\\Temp\\pip-install-ts0ir3mr\\MySQL-python\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Chrispa\AppData\Local\Temp\pip-record-wedev03m\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.

Unable to install mysql client 1.3.12 getting fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory

I am trying to install mysqlclient==1.3.12 from python 3.7.3 using pip install command and I am facing below error:
_mysql.c(29): fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.20.27508\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
And below is the log:
Building wheels for collected packages: mysqlclient
Building wheel for mysqlclient (setup.py) ... error
Complete output from command c:\users\rohit\appdata\local\programs\python\python37-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Rohit\\AppData\\Local\\Temp\\pip-install-5ngodhpx\\mysqlclient\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\Rohit\AppData\Local\Temp\pip-wheel-927n4lus --python-tag cp37:
running bdist_wheel
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\compat.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\connections.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\converters.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\CLIENT.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.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
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\2019\BuildTools\VC\Tools\MSVC\14.20.27508\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Dversion_info=(1,3,12,'final',0) -D__version__=1.3.12 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.1\include" -Ic:\users\rohit\appdata\local\programs\python\python37-32\include -Ic:\users\rohit\appdata\local\programs\python\python37-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.20.27508\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.20.27508\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /Tc_mysql.c /Fobuild\temp.win32-3.7\Release\_mysql.obj /Zl
_mysql.c
_mysql.c(29): fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.20.27508\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
----------------------------------------
Failed building wheel for mysqlclient
Running setup.py clean for mysqlclient
Failed to build mysqlclient
Installing collected packages: mysqlclient
Found existing installation: mysqlclient 1.4.2
Uninstalling mysqlclient-1.4.2:
Successfully uninstalled mysqlclient-1.4.2
Running setup.py install for mysqlclient ... error
Complete output from command c:\users\rohit\appdata\local\programs\python\python37-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Rohit\\AppData\\Local\\Temp\\pip-install-5ngodhpx\\mysqlclient\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Rohit\AppData\Local\Temp\pip-record-wi5jfwfg\install-record.txt --single-version-externally-managed --compile:
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\compat.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\connections.py -> build\lib.win32-3.7\MySQLdb
copying MySQLdb\converters.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\CLIENT.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win32-3.7\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.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
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\2019\BuildTools\VC\Tools\MSVC\14.20.27508\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Dversion_info=(1,3,12,'final',0) -D__version__=1.3.12 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.1\include" -Ic:\users\rohit\appdata\local\programs\python\python37-32\include -Ic:\users\rohit\appdata\local\programs\python\python37-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.20.27508\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.20.27508\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /Tc_mysql.c /Fobuild\temp.win32-3.7\Release\_mysql.obj /Zl
_mysql.c
_mysql.c(29): fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.20.27508\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
----------------------------------------
Rolling back uninstall of mysqlclient
Moving to c:\users\rohit\appdata\local\programs\python\python37-32\lib\site-packages\mysqlclient-1.4.2.dist-info\
from c:\users\rohit\appdata\local\programs\python\python37-32\lib\site-packages\~ysqlclient-1.4.2.dist-info
Moving to c:\users\rohit\appdata\local\programs\python\python37-32\lib\site-packages\mysqldb\
from c:\users\rohit\appdata\local\programs\python\python37-32\lib\site-packages\~ysqldb
Command "c:\users\rohit\appdata\local\programs\python\python37-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Rohit\\AppData\\Local\\Temp\\pip-install-5ngodhpx\\mysqlclient\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Rohit\AppData\Local\Temp\pip-record-wi5jfwfg\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Rohit\AppData\Local\Temp\pip-install-5ngodhpx\mysqlclient\
I Tried the following solutions available in stack over flow
1) Uninstall and installed Python 3.7
2) Installed Visual studio build tools 2019
3) Copied the mysql connector.C 6.1 folder to C:\Program Files (x86)\MySQL
4) Tried to download the whl files of mysql and install from command prompt. installed mysqlclient-1.4.2-cp37-cp37m-win32.whl
I am working on Windows 10 64 bit and python 3.7.3
Any other solutions to fix this issue?
I had the exact same issues and the only thing that worked for me was the first line of code from this website Unable to install mysql client 1.3.12 getting fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory. You have to be using the anaconda command prompt so download that if you haven't already.
The code
conda install -c bioconda mysqlclient
is what I used and it worked well.
I hope this helps!

Python pip install django mysql fails on Windows

I am trying to setup a django project on Windows 10 using Python 3.5 and Django 1.9. When I run the pip command to install MySQL support I get the following error. MySQL 5.7 is installed and running.
PS H:\> pip install django mysql
Requirement already satisfied (use --upgrade to upgrade): django in c:\python35\lib\site-packages
Collecting mysql
Using cached mysql-0.0.1.tar.gz
Collecting MySQL-python (from mysql)
Using cached MySQL-python-1.2.5.zip
Installing collected packages: MySQL-python, mysql
Running setup.py install for MySQL-python
Complete output from command c:\python35\python.exe -c "import setuptools, tokenize;__file__='C:\\Users\\JKRATZ~1.EVE\\AppData\\Local\\Temp\\pip-build-kr3v2d0u\\MySQL-python\\setup.py';exec(compile(get
attr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\JKRATZ~1.EVE\AppData\Local\Temp\pip-id62narl-record\install-record.txt --single-version-ex
ternally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.5
copying _mysql_exceptions.py -> build\lib.win-amd64-3.5
creating build\lib.win-amd64-3.5\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win-amd64-3.5\MySQLdb
copying MySQLdb\converters.py -> build\lib.win-amd64-3.5\MySQLdb
copying MySQLdb\connections.py -> build\lib.win-amd64-3.5\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win-amd64-3.5\MySQLdb
copying MySQLdb\release.py -> build\lib.win-amd64-3.5\MySQLdb
copying MySQLdb\times.py -> build\lib.win-amd64-3.5\MySQLdb
creating build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\REFRESH.py -> build\lib.win-amd64-3.5\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-3.5\MySQLdb\constants
running build_ext
building '_mysql' extension
creating build\temp.win-amd64-3.5
creating build\temp.win-amd64-3.5\Release
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 "-IC:\Program Files (x86)\MySQL\MySQL Co
nnector C 6.0.2\include" -Ic:\python35\include -Ic:\python35\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCL
UDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shar
ed" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt" /Tc_mysql.c /Fobuild\temp.win-amd64-3.5\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 14.0\\VC\\BIN\\amd64\\cl.exe' failed with exit status 2
----------------------------------------
Command "c:\python35\python.exe -c "import setuptools, tokenize;__file__='C:\\Users\\JKRATZ~1.EVE\\AppData\\Local\\Temp\\pip-build-kr3v2d0u\\MySQL-python\\setup.py';exec(compile(getattr(tokenize, 'open', o
pen)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\JKRATZ~1.EVE\AppData\Local\Temp\pip-id62narl-record\install-record.txt --single-version-externally-managed --compi
le" failed with error code 1 in C:\Users\JKRATZ~1.EVE\AppData\Local\Temp\pip-build-kr3v2d0u\MySQL-python
Installing MySQL support of Django on Windows is suffering and I came across the same question just like you. For my situation, I use python3.4, django1.8.5, I solved this problem by download wheel file from here and use pip to install it:
pip install ***.whl
I think there is an issue with finding the include file "config-win.h".
Please check out this error message:
_mysql.c(42): fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory
The have moved the include files to a separate folder.
Now they should be located in:
C:\Program Files\MySQL\Connector C 6.0.2\include
Please try the instructions from this link:
"Cannot open include file: 'config-win.h': No such file or directory" while installing mysql-python

Categories