pip3 install mysqlclient 报错 Command “python setup.py egg_info“ failed with error

pip3 install mysqlclient 报错 Command “python setup.py egg_info” failed with error

鉴于文章被盗:被盗网址:http://smartadmin.com.cn/smartadmin/show-13216.html
特此声明:源文链接:https://blog.csdn.net/weixin_44331765/article/details/120242211
源文链接

1. 软件描述

  1. centos 8.0
  2. python3.6
  3. 鉴于文章被盗:被盗网址:http://smartadmin.com.cn/smartadmin/show-13216.html
    特此声明:源文链接:https://blog.csdn.net/weixin_44331765/article/details/120242211

2. 问题描述

使用命令

pip3 install mysqlclient
报错
[root@z ~]# pip3 install mysqlclient
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Collecting mysqlclient
  Using cached https://files.pythonhosted.org/packages/3c/df/59cd2fa5e48d0804d213bdcb1acb4d08c403b61c7ff7ed4dd4a6a2deb3f7/mysqlclient-2.0.3.tar.gz
    Complete output from command python setup.py egg_info:
    /bin/sh: mysql_config: 未找到命令
    /bin/sh: mariadb_config: 未找到命令
    /bin/sh: mysql_config: 未找到命令
    mysql_config --version
    mariadb_config --version
    mysql_config --libs
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-8k22usrq/mysqlclient/setup.py", line 15, in <module>
        metadata, options = get_config()
      File "/tmp/pip-build-8k22usrq/mysqlclient/setup_posix.py", line 70, in get_config
        libs = mysql_config("libs")
      File "/tmp/pip-build-8k22usrq/mysqlclient/setup_posix.py", line 31, in mysql_config
        raise OSError("{} not found".format(_mysql_config_path))
    OSError: mysql_config not found
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-8k22usrq/mysqlclient/

3. 解决方法

yum install python3-devel mysql-devel 
  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值