centos7 安裝 mysql-python時 報錯 EnvironmentError: mysql_config not found

來源:互聯網
上載者:User

標籤:自己   nbsp   查看   eve   serve   erro   div   error:   .net   

 

pip install mysql-python

然後報錯

EnvironmentError: mysql_config not found

 

網上搜解決方案,需要安裝   mysql-devel

然後

yum install mysql-devel

也無法安裝,報錯內容大概是和mysql版本相關的問題

 

解決方案

自己下載和自己mysql版本匹配的mysql-devel

1.查看安裝了什麼版本的mysql和相關的包

rpm -qa | grep mysql

mysql-community-client-5.6.34-2.el7.x86_64
mysql-community-server-5.6.34-2.el7.x86_64
mysql-community-release-el7-5.noarch
mysql-community-common-5.6.34-2.el7.x86_64
mysql-community-libs-5.6.34-2.el7.x86_64

 

發現我的是社區版的5.6,下了不少非社區版的mysql-devel,一直失敗

2.下載對應版本的mysql-devel

mysql-community-devel

可以從這個網址搜尋得到    http://rpm.pbone.net/

wget ftp://mirror.switch.ch/pool/4/mirror/mysql/Downloads/MySQL-5.6/mysql-community-devel-5.6.38-2.sles12.x86_64.rpm
rpm -ivh mysql-community-devel-5.6.38-2.sles12.x86_64.rpm

3.安裝mysql-python

pip install mysql-python

 

然後就OK了

centos7 安裝 mysql-python時 報錯 EnvironmentError: mysql_config not found

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.