解决Ubuntu pip 安装 mysql-python包出错的问题
问题描述如下,报没有找到mysql_config环境变量
$pipinstallmysql-python CollectingMySQL-python==1.2.5(from-rrequirement(line16)) DownloadingMySQL-python-1.2.5.zip(108kB) 100%|################################|112kB56kB/s Completeoutputfromcommandpythonsetup.pyegg_info: sh:mysql_config:commandnotfound Traceback(mostrecentcalllast): File"",line1,in File"/tmp/pip-build-HVEeJz/MySQL-python/setup.py",line17,in metadata,options=get_config() File"setup_posix.py",line43,inget_config libs=mysql_config("libs_r") File"setup_posix.py",line25,inmysql_config raiseEnvironmentError("%snotfound"%(mysql_config.path,)) EnvironmentError:mysql_confignotfound ---------------------------------------- Command"pythonsetup.pyegg_info"failedwitherrorcode1in/tmp/pip-build-HVEeJz/MySQL-python/
解决:
因为相关依赖没有安装
Ubuntu/Debian
sudoapt-getinstalllibmysqlclient-dev
以上这篇解决Ubuntupip安装mysql-python包出错的问题就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持毛票票。