_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h':問題的解決 mysql安裝python

來源:互聯網
上載者:User

標籤:exe   成功   lan   err   and   知識庫   direct   cmd   本地   

在win7下安裝了Python後,想安裝python-MySQL,使用pip安裝出現如下問題:

>pip install MySQL-python

_mysql.c(42) : fatal error C1083: Cannot open include file: ‘config-win.h‘: No such file or directory error: command ‘"C:\Users\fnngj\AppData\Local\Programs\Common\Microsoft\Visual C ++ for Python\9.0\VC\Bin\amd64\cl.exe"‘ failed with exit status 2

網上一般的解釋是,重新安裝mysql並在安裝mysql是選擇安裝c++的編譯器。。。

我雖然沒試過,但感覺肯定行不通啊,我只是想裝一個可以讓python遠端連線mysql的包而已,管本地mysql什麼事?有些解釋真是誤人子弟。

但錯誤提示裡也謝了缺少C++的相關環境,後來在網上找到方法了:
方法如下:

1.在http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python下載對應的包版本,如果是win7 64位2.7版本的python,就下載

MySQL_python-1.2.5-cp27-none-win_amd64.whl

然後在命令列執行pip install MySQL_python-1.2.5-cp27-none-win_amd64.whl

當然需要在cmd下跳轉到下載MySQL_python-1.2.5-cp27-none-win_amd64.whl的目錄下

然後就安裝成功了MySQL-python

 

參考連結:

http://www.cnblogs.com/fnng/p/4115607.html

_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h':問題的解決 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.