Bug - MySQL Client - Installation Failure

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/67/g6ljn0wn3gd2hz1n0_9p0dtc0000gn/T/pip-install-lxstynij/mysqlclient_aaa08edd50934ae9a0946d998dab1cd2/setup.py”, line 15, in
metadata, options = get_config()
File “/private/var/folders/67/g6ljn0wn3gd2hz1n0_9p0dtc0000gn/T/pip-install-lxstynij/mysqlclient_aaa08edd50934ae9a0946d998dab1cd2/setup_posix.py”, line 70, in get_config
libs = mysql_config(“libs”)
File “/private/var/folders/67/g6ljn0wn3gd2hz1n0_9p0dtc0000gn/T/pip-install-lxstynij/mysqlclient_aaa08edd50934ae9a0946d998dab1cd2/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.

Environment:

Is there an elegant solution available for Django 4.0.6 and MySQL 8.0.29
and MySQL Client 2.1.1?

This type of error is frequently caused by a missing “dev” package dependency.

What is the name of the specific package you are trying to install here? What operating system are you trying to install this on?

Thank you for your response.

The environment is pretty basic at this point.

I have a Python Project using Django.

I have my first app and associated tables migrated to sqllight.

I have MySQL on my machine with MySQL Workbench. The MySQL server is set up and I use MySQL Workbench.

I was following the Django Docs and was told I must install MySQLClient.

MySQLClient 2.1.1 needed to be installed first before I could change the database settings to MySQL.

I get an error that states it is not a pip issue but an issue with MySQLClient.

If you are looking for assistance here, you need to be a lot more specific.

What is the exact name of the specific package you are trying to install here?

What is the complete command you are using to try and install it?

What operating system are you trying to install this on?

Ken,

Is this what you need?

Here is the actual request with associated error:

Error I am getting while trying to install mysqlclient.

Error Response: This is likely caused by a bug in mysqlclient. Report this to its maintainers.

This is error note:

Preparing metadata (setup.py) … error

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

✘ Installation Failed

(Comm2022) johnkpeterson@Johns-MacBook-Pro storefront % ls
db.sqlite3 manage.py store tags
likes playground storefront
(Comm2022) johnkpeterson@Johns-MacBook-Pro storefront % ls
db.sqlite3 manage.py store tags
likes playground storefront
(Comm2022) johnkpeterson@Johns-MacBook-Pro storefront % pip install mysqlclient
Collecting mysqlclient
Using cached mysqlclient-2.1.1.tar.gz (88 kB)
Preparing metadata (setup.py) … 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/67/g6ljn0wn3gd2hz1n0_9p0dtc0000gn/T/pip-install-4za4aib8/mysqlclient_01dc626ab7bf4d969a0cc979b167e3e7/setup.py”, line 15, in
metadata, options = get_config()
File “/private/var/folders/67/g6ljn0wn3gd2hz1n0_9p0dtc0000gn/T/pip-install-4za4aib8/mysqlclient_01dc626ab7bf4d969a0cc979b167e3e7/setup_posix.py”, line 70, in get_config
libs = mysql_config(“libs”)
File “/private/var/folders/67/g6ljn0wn3gd2hz1n0_9p0dtc0000gn/T/pip-install-4za4aib8/mysqlclient_01dc626ab7bf4d969a0cc979b167e3e7/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.

The mysql db and mysql db are running in activity monitor.

Saw this error: (Never set this in my old Mac)

Start MySQL: ~/sandboxes/msb_|Enter version here|/start
Stop MySQL: ~/sandboxes/msb_|Enter version here|/stop

MySQL Configuration
MySQL Version: 8.0.29
Settings Template: MySQL Sandbox MacOS(MySQL tar package)
Path to Configuration File: ~/sandboxes/msb_|Enter version here|/my.sandbox.cnf
Instance Name in Configuration File: mysqld

Commands for MySQL Management
Start MySQL: ~/sandboxes/msb_|Enter version here|/start
Stop MySQL: ~/sandboxes/msb_|Enter version here|/stop
Use sudo: No
~/sandboxes/msb_
zsh: command not found: MySQL
zsh: command not found: MySQL
zsh: unknown file attribute: y
zsh: command not found: Path
zsh: command not found: Enter
zsh: no such file or directory: /my.sandbox.cnf
zsh: command not found: Instance
zsh: command not found: Commands
zsh: command not found: Start
zsh: command not found: Enter
zsh: no such file or directory: /start
zsh: command not found: Stop
zsh: command not found: Enter
zsh: no such file or directory: /stop
zsh: command not found: Use
zsh: no such file or directory: /Users/johnkpeterson/sandboxes/msb_
johnkpeterson@Johns-MacBook-Pro ~ % ~/sandboxes
zsh: no such file or directory: /Users/johnkpeterson/sandboxes
johnkpeterson@Johns-MacBook-Pro ~ % ls
Comm2022 Documents Library Music Public
Desktop Downloads Movies Pictures

MacBook Pro M1 2021 Chip: Apple M1 Max 64 GB Memory
masOS Monterey Version 12.4

Currently installed Django 4.0.6 and MySQL 8.0.29(Working with MySQL Workbench - DataBase Established called “storefront”
Cannot install MySQL Client 2.1.1.

Is this what you need?

Tried a few suggestions based on stack overflow but same errors. was able to install:

(Comm2022) johnkpeterson@Johns-MacBook-Pro storefront % pip install mysql-connector-python
Collecting mysql-connector-python
Downloading mysql_connector_python-8.0.29-py2.py3-none-any.whl (342 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 342.0/342.0 kB 1.0 MB/s eta 0:00:00
Collecting protobuf>=3.0.0
Downloading protobuf-4.21.3-cp37-abi3-macosx_10_9_universal2.whl (484 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 484.1/484.1 kB 1.8 MB/s eta 0:00:00
Installing collected packages: protobuf, mysql-connector-python
Successfully installed mysql-connector-python-8.0.29 protobuf-4.21.3
(Comm2022) johnkpeterson@Johns-MacBook-Pro storefront % pip install pymysql
Collecting pymysql
Using cached PyMySQL-1.0.2-py3-none-any.whl (43 kB)
Installing collected packages: pymysql
Successfully installed pymysql-1.0.2
(Comm2022) johnkpeterson@Johns-MacBook-Pro storefront %

Tried: (Comm2022) johnkpeterson@Johns-MacBook-Pro storefront % locate mysql_config

WARNING: The locate database (/var/db/locate.database) does not exist.
To create the database, run the following command:

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist

Looking for password - Will not accept working passwords for Mac or Data Base or MySQL Workbench

I am the only person on this machine.

Hope this helps