Installing MySQL Python on Mac OS X: Troubleshooting Installation Errors
When attempting to install MySQL-python using easy_install, you may encounter the error "mysql_config not found." To resolve this, you may have tried setting the PATH environment variable to include the MySQL bin directory.
However, if you are still encountering errors, such as "command 'llvm-gcc-4.2' failed with exit status 1," it is likely due to a missing or incorrect GCC package. Instead of manually downloading and installing GCC, it is recommended to use the Homebrew package manager.
Steps to Install MySQL Python on Mac OS X Using Homebrew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install mysql-connector-c
pip install mysql-python
By following these steps, you should be able to successfully install MySQL Python on your Mac OS X system. Homebrew will handle all necessary dependencies and ensure that the correct versions of GCC and other required software are installed.
The above is the detailed content of How to Fix \'mysql_config not found\' and Other MySQL-python Installation Errors on macOS?. For more information, please follow other related articles on the PHP Chinese website!