mac下pip install -r requirements.txt安装mysqlclient报错
```bash
Collecting mysqlclient==2.1.1 (from -r requirements.txt (line 17))
Using cached mysqlclient-2.1.1.tar.gz (88 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [16 lines of output]
/bin/sh: mysql_config: command not found
/bin/sh: mariadb_config: command not found
/bin/sh: mysql_config: command not found
OSError: mysql_config not found
mysql_config --version
mariadb_config --version
mysql_config --libs
[end of output]
主要报错信息:
/bin/sh: mysql_config: command not found
/bin/sh: mariadb_config: command not found
/bin/sh: mysql_config: command not found
OSError: mysql_config not found
我安装的是mysql8.0,在vscode终端输入mysql提示找不到
添加mysql路径后在编辑器终端进行测试,提示如下证明OK了文章来源:https://www.toymoban.com/news/detail-608375.html
% PATH="$PATH":/usr/local/mysql/bin
% mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
主要原因是没有设置环境变量导致无法识别路径文章来源地址https://www.toymoban.com/news/detail-608375.html
到了这里,关于/bin/sh: mysql_config: command not found的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!