Mac OS 10.12下安裝Mysql-python問題

來源:互聯網
上載者:User

標籤:python   mysql   

在MAC下做django環境搭建的時候,發現在使用pip安裝mysql-python時出現錯誤:

EnvironmentError: mysql_config not foun


在網上看了看資料,解決辦法如下:

1、下載MySQL-Python(在網上自己百度下載,我用的1.2.4)

2、解壓,setup_posix.py中mysql_config.path更改如下:

mysql_config.path = "/usr/local/mysql-5.7.18-macos10.12-x86_64/bin/mysql_config"

3、將site.cfg中mysql_config.path前的#號去掉,並更改內容如下:

mysql_config = /usr/local/mysql-5.7.18-macos10.12-x86_64/bin/mysql_config

4、在終端中使用python setup.py install


註:mysql-5.7.18-macos10.12-x86_64/bin/mysql_config是安裝mysql的路徑,請根據情況更改。


本文出自 “AiCCDD” 部落格,請務必保留此出處http://520ccdd.blog.51cto.com/3926314/1918411

Mac OS 10.12下安裝Mysql-python問題

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.