Package ‘libmysqld-dev’ has no installation candidate

安装 mysql-Python 的时候提示错误:

maydolly@localhost:~/MySQL-python-1.2.5$ sudo pip install MySQL-Python
Collecting MySQL-Python
  Using cached MySQL-python-1.2.5.zip
    Complete output from command python setup.py egg_info:
    sh: 1: mysql_config: not found
    Traceback (most recent call last):
      File “<string>”, line 1, in <module>
      File “/tmp/pip-build-yZtb7x/MySQL-Python/setup.py”, line 17, in <module>
        metadata, options = get_config()
      File “setup_posix.py”, line 43, in get_config
        libs = mysql_config(“libs_r”)
      File “setup_posix.py”, line 25, 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-yZtb7x/MySQL-Python/
缺乏文件 mysql_config ,网上查了,说是需要安装插件:libmysqld-dev

但是,又跳出错误:

maydolly@localhost:/usr/local$ sudo apt-get install libmysqld-dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package libmysqld-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  libmariadbd18 libmariadbd-dev
E: Package ‘libmysqld-dev’ has no installation candidate
再去找问题:E: Package ‘libmysqld-dev’ has no installation candidate

然后就卡住了,死活找不到适用的解决办法,更新库,更新源,全是失败。

再仔细看了一下错误描述,发现有这么一句话:

However the following packages replace it:
libmariadbd18 libmariadbd-dev

原来的包已经过时,需要用新包替换了!!!重新执行:

 sudo apt-get install libmariadbd18 libmariadbd-dev

终于成功了!

在执行mysql-Python安装指令:Successfully installed mysql-Python-1.2.5
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值