我尝试使用Django构建应用程序,并希望使用MySQL作为数据库。在正确设置settings.py之后,我尝试进行迁移。然而,我遇到了明显的错误,提示MySQL未安装。所以为了安装MySQL,我运行了以下命令:
sudo -H pip install MySQL-python
I get the following error:
Collecting MySQL-python
Using cached MySQL-python-1.2.5.zip
Complete output from command python setup.py egg_info:
sh: mysql_config: command not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/tmp/pip-build-zAMhWo/MySQL-python/setup.py", line 17, in <module>
metadata, options = get_config()
File "setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "setup_posix.py", line 25, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-zAMhWo/MySQL-python/
我该如何修复这个问题?