# Mysqlclient installation error

**URL:** <https://forum.codewithmosh.com/t/mysqlclient-installation-error/9300>\
**Category:** Django\
**Created:** [December 20, 2021, 8:46am UTC](https://forum.codewithmosh.com/t/mysqlclient-installation-error/9300 "2021-12-20T08:46:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![akinro](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@akinro](https://forum.codewithmosh.com/u/akinro)\
**Post date:** [December 20, 2021, 8:46am UTC](https://forum.codewithmosh.com/t/mysqlclient-installation-error/9300/1 "2021-12-20T08:46:10Z")

</div>

please i keep getting this error wen i use pipenv install mysqlclient despite already having visual c++ 14.29

Installing mysqlclient…  
Error: An error occurred while installing mysqlclient!  
Error text: Collecting mysqlclient  
Using cached mysqlclient-2.1.0.tar.gz (87 kB)  
Preparing metadata (setup.py): started  
Preparing metadata (setup.py): finished with status ‘done’  
Building wheels for collected packages: mysqlclient  
Building wheel for mysqlclient (setup.py): started  
Building wheel for mysqlclient (setup.py): finished with status ‘error’  
Running setup.py clean for mysqlclient  
Failed to build mysqlclient  
Installing collected packages: mysqlclient  
Running setup.py install for mysqlclient: started  
Running setup.py install for mysqlclient: finished with status ‘error’

ERROR: Command errored out with exit status 1:  
command: ‘C:\Users\Akinro.virtualenvs\APILagosDowntown-vQiU3gsE\Scripts\python.exe’ -u -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘"’“‘C:\Users\Akinro\AppData\Local\Temp\pip-install-tt8i\_uqm\mysqlclient\_acc19755012c4c0bae994e989fca3fc4\setup.py’”’“‘; **file** =’”‘“‘C:\Users\Akinro\AppData\Local\Temp\pip-install-tt8i\_uqm\mysqlclient\_acc19755012c4c0bae994e989fca3fc4\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’”’"‘))’ bdist\_wheel -d ‘C:\Users\Akinro\AppData\Local\Temp\pip-wheel-v6wllrh7’  
cwd: C:\Users\Akinro\AppData\Local\Temp\pip-install-tt8i\_uqm\mysqlclient\_acc19755012c4c0bae994e989fca3fc4  
Complete output (25 lines):  
running bdist\_wheel  
running build  
running build\_py  
creating build  
creating build\lib.win32-3.7  
creating build\lib.win32-3.7\MySQLdb  
copying MySQLdb\__init_\_.py → build\lib.win32-3.7\MySQLdb  
copying MySQLdb\_exceptions.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  
warning: build\_py: byte-compiling is disabled, skipping.

## running build\_ext building ‘MySQLdb.\_mysql’ extension error: Microsoft Visual C++ 14.0 or greater is required. Get it with “Microsoft C++ Build Tools”: [Microsoft C++ Build Tools - Visual Studio](https://visualstudio.microsoft.com/visual-cpp-build-tools/)

ERROR: Failed building wheel for mysqlclient  
ERROR: Command errored out with exit status 1:  
command: ‘C:\Users\Akinro.virtualenvs\APILagosDowntown-vQiU3gsE\Scripts\python.exe’ -u -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘"’“‘C:\Users\Akinro\AppData\Local\Temp\pip-install-tt8i\_uqm\mysqlclient\_acc19755012c4c0bae994e989fca3fc4\setup.py’”’“‘; **file** =’”‘“‘C:\Users\Akinro\AppData\Local\Temp\pip-install-tt8i\_uqm\mysqlclient\_acc19755012c4c0bae994e989fca3fc4\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\Akinro\AppData\Local\Temp\pip-record-eoopo0x7\install-record.txt’ --single-version-externally-managed --compile --install-headers ‘C:\Users\Akinro.virtualenvs\APILagosDowntown-vQiU3gsE\include\site\python3.7\mysqlclient’  
cwd: C:\Users\Akinro\AppData\Local\Temp\pip-install-tt8i\_uqm\mysqlclient\_acc19755012c4c0bae994e989fca3fc4  
Complete output (27 lines):  
running install  
C:\Users\Akinro.virtualenvs\APILagosDowntown-vQiU3gsE\lib\site-packages\setuptools\command\install.py:37: SetuptoolsDeprecationWarning: setup.py  
install is deprecated. Use build and pip and other standards-based tools.  
setuptools.SetuptoolsDeprecationWarning,  
running build  
running build\_py  
creating build  
creating build\lib.win32-3.7  
creating build\lib.win32-3.7\MySQLdb  
copying MySQLdb\__init_\_.py → build\lib.win32-3.7\MySQLdb  
copying MySQLdb\_exceptions.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  
warning: build\_py: byte-compiling is disabled, skipping.

```
running build_ext
building 'MySQLdb._mysql' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------

```

ERROR: Command errored out with exit status 1: ‘C:\Users\Akinro.virtualenvs\APILagosDowntown-vQiU3gsE\Scripts\python.exe’ -u -c ‘import io, os, sys,  
setuptools, tokenize; sys.argv[0] = ‘"’“‘C:\Users\Akinro\AppData\Local\Temp\pip-install-tt8i\_uqm\mysqlclient\_acc19755012c4c0bae994e989fca3fc4\setup.py’”’“‘; **file** =’”‘“‘C:\Users\Akinro\AppData\Local\Temp\pip-install-tt8i\_uqm\mysqlclient\_acc19755012c4c0bae994e989fca3fc4\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\Akinro\AppData\Local\Temp\pip-record-eoopo0x7\install-record.txt’ --single-version-externally-managed --compile --install-headers ‘C:\Users\Akinro.virtualenvs\APILagosDowntown-vQiU3gsE\include\site\python3.7\mysqlclient’ Check the logs  
for full command output.  
[===]  
Installation Failed
