安装mysqlclient时报错
报错内容:
pip install mysqlclient
Collecting mysqlclient
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
╰─> [18 lines of output]
/bin/sh: mysql_config: command not found
/bin/sh: mariadb_config: command not found
/bin/sh: mysql_config: command not found
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/private/var/folders/pc/4rdxcdhx4cg_sz00rxkf499h0000gn/T/pip-install-pzzaabno/mysqlclient_85fc99e846cf49e89a537e47d94f2bda/setup.py", line 15, in <module>
metadata, options = get_config()
^^^^^^^^^^^^
File "/private/var/folders/pc/4rdxcdhx4cg_sz00rxkf499h0000gn/T/pip-install-pzzaabno/mysqlclient_85fc99e846cf49e89a537e47d94f2bda/setup_posix.py", line 70, in get_config
libs = mysql_config("libs")
^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/pc/4rdxcdhx4cg_sz00rxkf499h0000gn/T/pip-install-pzzaabno/mysqlclient_85fc99e846cf49e89a537e47d94f2bda/setup_posix.py", line 31, in mysql_config
raise OSError("{} not found".format(_mysql_config_path))
OSError: mysql_config not found
mysql_config --version
mariadb_config --version
mysql_config --libs
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
正在回答 回答被采纳积分+1
- 参与学习 人
- 提交作业 5228 份
- 解答问题 2433 个
Facebook曾声称“只招全栈工程师”!全栈用人需求猛增,市面人才紧缺。 0基础进击Python全栈开发,诱人薪资在前方!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星