I face this problem when I want to install mysql-python on osx 10.8, it show error with 'my_config.h' file not found.
Below is my running code:
sudo easy_install mysql-python Password: Searching for mysql-python Reading http://pypi.python.org/simple/mysql-python/ Reading http://sourceforge.net/projects/mysql-python/ Reading http://sourceforge.net/projects/mysql-python Best match: MySQL-python 1.2.3 Downloading http://pypi.python.org/packages/source/M/MySQL-python/MySQL-python-1.2.3.tar.gz#md5=215eddb6d853f6f4be5b4afc4154292f Processing MySQL-python-1.2.3.tar.gz Running MySQL-python-1.2.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-UoZlf7/MySQL-python-1.2.3/egg-dist-tmp-phaQqE warning: no files found matching 'MANIFEST' warning: no files found matching 'ChangeLog' warning: no files found matching 'GPL' clang: warning: argument unused during compilation: '-mno-fused-madd' _mysql.c:36:10: fatal error: 'my_config.h' file not found #include "my_config.h" ^ 1 error generated. error: Setup script exited with error: command 'clang' failed with exit status 1 ninjaiimac:MySQL-python-1.2.3 sunninjaisun$
Pip Command to install MySQL Connector python MySQL Connector Python is available on pypi.org, so you can install it using the pip command.
MySQL server and Python versions within parentheses are known to work with Connector/Python, but are not officially supported. Bugs might not get fixed for those versions. Connector/Python does not support the old MySQL Server authentication methods, which means that MySQL versions prior to 4.1 will not work.
The easiest way to probably install and use MySQL in Python is to open up your command prompt. Once the command prompt is opened, then specify the full path to the Scripts folder of the Python package. Once you have this full path specified to the Scripts folder, then type in, pip install pymysql.
brew install mysql brew unlink mysql brew install mysql-connector-c sed -i -e 's/libs="$libs -l "/libs="$libs -lmysqlclient -lssl -lcrypto"/g' /usr/local/bin/mysql_config pip install MySQL-python brew unlink mysql-connector-c brew link --overwrite mysql
Works well on macOS High Sierra:
If you haven't already installed mysql: brew install mysql
brew unlink mysql brew install mysql-connector-c brew link --overwrite mysql pip install MySQL-python
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With