请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

mysqlclient

(zanhu_env) [root@localhost zanhu]# pip3 install -r requirements.txt

ollecting mysqlclient==1.4.2.post1
Downloading http://mirrors.aliyun.com/pypi/packages/f4/f1/3bb6f64ca7a429729413e6556b7ba5976df06019a5245a43d36032f1061e/mysqlclient-1.4.2.post1.tar.gz (85 kB)
|████████████████████████████████| 85 kB 40.7 MB/s
ERROR: Command errored out with exit status 1:
command: /home/zanhu/zanhu_env/bin/python3 -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-tvuasq6b/mysqlclient/setup.py’"’"’; file=’"’"’/tmp/pip-install-tvuasq6b/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-7n4cc2mx
cwd: /tmp/pip-install-tvuasq6b/mysqlclient/
Complete output (10 lines):
/bin/sh: mysql_config: 未找到命令
Traceback (most recent call last):
File “”, line 1, in
File “/tmp/pip-install-tvuasq6b/mysqlclient/setup.py”, line 16, in
metadata, options = get_config()
File “/tmp/pip-install-tvuasq6b/mysqlclient/setup_posix.py”, line 51, in get_config
libs = mysql_config(“libs”)
File “/tmp/pip-install-tvuasq6b/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.

正在回答 回答被采纳积分+3

1回答

Jack 2020-05-21 17:19:35

像是系统上少了什么依赖。

yum -y install python-devel zlib-devel mysql-devel libffi-devel bzip2-devel openssl-devel java wget gcc

0 回复 有任何疑惑可以回复我~
  • 提问者 慕姐7027134 #1
    执行上面的命令后(yum -y install python-devel zlib-devel mysql-devel libffi-devel bzip2-devel openssl-devel java wget gcc): 
    正在处理依赖关系 mariadb-libs(x86-64) = 1:5.5.65-1.el7,它被软件包 1:mariadb-devel-5.5.65-1.el7.x86_64 需要
    --> 正在处理依赖关系 libmysqlclient.so.18(libmysqlclient_18)(64bit),它被软件包 2:postfix-2.10.1-7.el7.x86_64 需要
    --> 正在处理依赖关系 libmysqlclient.so.18()(64bit),它被软件包 2:postfix-2.10.1-7.el7.x86_64 需要
    --> 正在处理依赖关系 libmysqlclient.so.18()(64bit),它被软件包 1:mariadb-devel-5.5.65-1.el7.x86_64 需要
    --> 解决依赖关系完成
    错误:软件包:1:mariadb-devel-5.5.65-1.el7.x86_64 (base)
              需要:mariadb-libs(x86-64) = 1:5.5.65-1.el7
    错误:软件包:1:mariadb-devel-5.5.65-1.el7.x86_64 (base)
              需要:libmysqlclient.so.18()(64bit)
    错误:软件包:2:postfix-2.10.1-7.el7.x86_64 (@base)
              需要:libmysqlclient.so.18(libmysqlclient_18)(64bit)
    错误:软件包:2:postfix-2.10.1-7.el7.x86_64 (@base)
              需要:libmysqlclient.so.18()(64bit)
     您可以尝试添加 --skip-broken 选项来解决该问题
    ** 发现 2 个已存在的 RPM 数据库问题, 'yum check' 输出如下:
    2:postfix-2.10.1-7.el7.x86_64 有缺少的需求 libmysqlclient.so.18()(64bit)
    2:postfix-2.10.1-7.el7.x86_64 有缺少的需求 libmysqlclient.so.18(libmysqlclient_18)(64bit)
    回复 有任何疑惑可以回复我~ 2020-05-21 19:01:17
  • Jack 回复 提问者 慕姐7027134 #2
    试试 
    rpm -ivh mysql-community-libs-compat-5.7.19-1.el7.x86_64.rpm
    然后重新安装postfix:
    sudo yum install postfix
    sudo systemctl start postfix
    sudo systemctl enable postfix
    回复 有任何疑惑可以回复我~ 2020-05-24 20:28:47
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信