Django使用Mysql需要安装mysqlclient,在Mac下pip install mysqlclient
时部分报错如下:
Complete output (15 lines):
/bin/sh: mysql_config: command not found
/bin/sh: mariadb_config: command not found
/bin/sh: mysql_config: command not found
其原因是需要先安装mysql-connector-c依赖,敲命令brew install mysql-connector-c
可能会遇到以下多个类似的报错:
Error: No such file or directory @ rb_sysopen - /Users/xxx/Library/Caches/Homebrew/downloads/c823214bc41070419ed515910eef727e89805913e159fb2a357749bf42fc6b5d--libcbor-0.9.0.monterey.bottle.tar.gz
此类情况也是缺少相关依赖导致的,同样先安装libcbor
(版本号0.9.0前就是包名),敲命令brew install libcbor
直到mysql-connector-c安装成功,然后就可以在python中安装mysqlclient了。
标签:mysqlclient,connector,报错,install,mysql,pip From: https://www.cnblogs.com/huihuo/p/17136941.html