gpt4 book ai didi

python - centos7.3上无法安装mysqlclient

转载 作者:行者123 更新时间:2023-11-29 18:04:22 25 4
gpt4 key购买 nike

当我使用pip安装mysqlclient时,显示找不到mysql_config:

   [root@iZus9gnp1cZ local]# pip install mysqlclient Collecting mysqlclient   Downloading http://mirrors.aliyun.com/pypi/packages/6f/86/bad31f1c1bb0cc99e88ca2adb7cb5c71f7a6540c1bb001480513de76a931/mysqlclient-1.3.12.tar.gz (89kB)
100% |████████████████████████████████| 92kB 13.0MB/s
Complete output from command python setup.py egg_info:
sh: mysql_config: command not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-OJR4Al/mysqlclient/setup.py", line 17, in <module>
metadata, options = get_config()
File "setup_posix.py", line 44, in get_config
libs = mysql_config("libs_r")
File "setup_posix.py", line 26, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found

---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-OJR4Al/mysqlclient/

谷歌之后,我找到了一些建议sudo yum install python-devel mysql-devel

但没有成功:

[root@iZus9gnp1cZ local]# yum install python-devel mysql-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Package python-devel-2.7.5-58.el7.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package mariadb-devel.x86_64 1:5.5.56-2.el7 will be installed
--> Processing Dependency: mariadb-libs(x86-64) = 1:5.5.56-2.el7 for package: 1:mariadb-devel-5.5.56-2.el7.x86_64
--> Running transaction check
---> Package mariadb-libs.x86_64 1:5.5.56-2.el7 will be installed
Removing mariadb-libs.x86_64 1:5.5.56-2.el7 - u due to obsoletes from installed mysql-community-libs-5.7.20-1.el7.x86_64
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package mariadb-libs.x86_64 1:5.5.56-2.el7 will be installed
--> Processing Dependency: mariadb-libs(x86-64) = 1:5.5.56-2.el7 for package: 1:mariadb-devel-5.5.56-2.el7.x86_64
--> Finished Dependency Resolution
Error: Package: 1:mariadb-devel-5.5.56-2.el7.x86_64 (base)
Requires: mariadb-libs(x86-64) = 1:5.5.56-2.el7
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

我的centos版本是7.3,python 3.4.2

最佳答案

我在安装mysql之前重新安装了它,它可以工作!我猜这个命令“yum -y remove mysql57-community-release-el7-10.noarch”会破坏环境文件。

关于python - centos7.3上无法安装mysqlclient,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48034645/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com