安装 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
源是啥