# Error while installing mysqlclient

**URL:** https://forum.codewithmosh.com/t/error-while-installing-mysqlclient/12802
**Category:** Django
**Created:** [June 2, 2022, 5:09am UTC](https://forum.codewithmosh.com/t/error-while-installing-mysqlclient/12802 "2022-06-02T05:09:20Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Jkrans](https://avatars.discourse-cdn.com/v4/letter/j/df705f/32.png) [@Jkrans](https://forum.codewithmosh.com/u/Jkrans)
#### Post date: [June 2, 2022, 5:09am UTC](https://forum.codewithmosh.com/t/error-while-installing-mysqlclient/12802/1 "2022-06-02T05:09:20Z")

</div>

I’m getting this error and I’m not sure what to do:  
(storefront) jk@Js-MacBook-Pro storefront % pipenv install mysqlclient  
Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. You can set PIPENV\_IGNORE\_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead. You can set PIPENV\_VERBOSITY=-1 to suppress this warning.  
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 ‘error’

error: subprocess-exited-with-error

× python setup.py egg\_info did not run successfully.  
│ exit code: 1  
╰─\> [16 lines of output]  
/bin/sh: mysql\_config: command not found  
/bin/sh: mariadb\_config: command not found  
/bin/sh: mysql\_config: command not found  
Traceback (most recent call last):  
File “”, line 2, in   
File “”, line 34, in   
File “/private/var/folders/nj/68lswz4j45721k4myrqmxgsc0000gn/T/pip-install-qit6qm0x/mysqlclient\_9dcde103db174e888b03e0ca56a33fec/setup.py”, line 15, in   
metadata, options = get\_config()  
File “/private/var/folders/nj/68lswz4j45721k4myrqmxgsc0000gn/T/pip-install-qit6qm0x/mysqlclient\_9dcde103db174e888b03e0ca56a33fec/setup\_posix.py”, line 70, in get\_config  
libs = mysql\_config(“libs”)  
File “/private/var/folders/nj/68lswz4j45721k4myrqmxgsc0000gn/T/pip-install-qit6qm0x/mysqlclient\_9dcde103db174e888b03e0ca56a33fec/setup\_posix.py”, line 31, in mysql\_config  
raise OSError("{} not found".format(\_mysql\_config\_path))  
OSError: mysql\_config not found  
mysql\_config --version  
mariadb\_config --version  
mysql\_config --libs  
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.  
error: metadata-generation-failed

× Encountered error while generating package metadata.  
╰─\> See above for output.

note: This is an issue with the package mentioned above, not pip.  
hint: See above for details.

This is likely caused by a bug in mysqlclient. Report this to its maintainers.  
✘ Installation Failed

---

<div class="post-metadata">

### Author: ![SUPERCAT](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@SUPERCAT](https://forum.codewithmosh.com/u/SUPERCAT)
#### Post date: [July 13, 2022, 2:07am UTC](https://forum.codewithmosh.com/t/error-while-installing-mysqlclient/12802/2 "2022-07-13T02:07:59Z")

</div>

@Jkrans I’m getting the same error when installing mysqlclient with pipenv. Any help?

---

<div class="post-metadata">

### Author: ![tooTALLtim](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/tootalltim/32/5469_2.png) [@tooTALLtim](https://forum.codewithmosh.com/u/tooTALLtim)
#### Post date: [August 4, 2022, 6:51pm UTC](https://forum.codewithmosh.com/t/error-while-installing-mysqlclient/12802/3 "2022-08-04T18:51:03Z")

</div>

I answered this recently in a couple other questions and it won’t let me copy the answer as it thinks I’m spamming the forum 😛

Check this out and research what will work for your OS

> <https://stackoverflow.com/questions/63342767/command-errored-out-with-exit-status-1-python-setup-py-egg-info-check-the-logs>

---

<div class="post-metadata">

### Author: ![SUPERCAT](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@SUPERCAT](https://forum.codewithmosh.com/u/SUPERCAT)
#### Post date: [August 10, 2022, 10:34am UTC](https://forum.codewithmosh.com/t/error-while-installing-mysqlclient/12802/4 "2022-08-10T10:34:41Z")

</div>

Thanks, Ill take a look
