Error while installing mysqlclient

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

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

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 :stuck_out_tongue:

Check this out and research what will work for your OS

Thanks, Ill take a look