Error Message:
EnvironmentError: mysql_config not found
Command “python setup.py egg_info” failed with error code 1 in /private/var/folders/nh/j05szmpj19368dd9_y6whgy40000gq/T/pip-install-n9Jonx/mysql-python/
I looked up the command to execute an environment variable online:
export PATH=$PATH:/usr/local/mysql/bin
Then another error was reported:
#include “my_config.h”
^~~~~~~~~~~~~
1 error generated.
error: command ‘cc’ failed with exit status 1
Finally, I used two methods
One is to first execute :
brew install mysql
Be sure to install through brew
Second, download directly:
https://dev.mysql.com/downloads/connector/python/
After downloading, you can access:
/ usr/local/mysql/bin In this folder, you can see that there is a file called mysql_Config file
Since I did both things at the same time, I can’t judge which is right and which is wrong, or both, and then execute it again:
export PATH=$PATH:/usr/local/mysql/bin
Latest run: Good install MySQL-Python