[转]centos 安装mysqlclient报错
报错详情
(v1) [root@djc_nb djc_wcapp]# pip install mysqlclient
Looking in indexes: http://mirrors.cloud.aliyuncs.com/pypi/simple/
Collecting mysqlclient
Downloading http://mirrors.cloud.aliyuncs.com/pypi/packages/d0/97/7326248ac8d5049968bf4ec708a5d3d4806e412a42e74160d7f266a3e03a/mysqlclient-1.4.6.tar.gz (85 kB)
|████████████████████████████████| 85 kB 9.6 MB/s
ERROR: Command errored out with exit status 1:
command: /root/.virtualenvs/v1/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-nyt2x33a/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-nyt2x33a/mysqlclient/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-d8v3c3i3
cwd: /tmp/pip-install-nyt2x33a/mysqlclient/
Complete output (12 lines):
/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 1, in <module>
File "/tmp/pip-install-nyt2x33a/mysqlclient/setup.py", line 16, in <module>
metadata, options = get_config()
File "/tmp/pip-install-nyt2x33a/mysqlclient/setup_posix.py", line 61, in get_config
libs = mysql_config("libs")
File "/tmp/pip-install-nyt2x33a/mysqlclient/setup_posix.py", line 29, in mysql_config
raise EnvironmentError("%s not found" % (_mysql_config_path,))
OSError: mysql_config not found
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
处理方式
网上大多数的解决方法都是用 apt-get install libmysqlclient-dev
然而我用的是Centos的操作系统,其实我们可以用另一条命令去解决yum install mysql-devel(安装依赖);
然后再执行 pip install mysqlclient
posted on 2021-10-08 10:39 torotoise512 阅读(82) 评论(0) 收藏 举报

浙公网安备 33010602011771号