python 安裝 mysql-python遇到的問題

來源:互聯網
上載者:User

標籤:

先通過 pip install mysql-python 報錯

 

後來下載安裝,報錯:

File "setup.py", line 15, in <module>

   metadata, options = get_config()

 File "F:\devtools\MySQL-python-1.2.3\setup_windows.py", line7, in get_config

   serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, options[‘ registry_ke

y‘] )

WindowsError: [Error 2] The system cannotfind the file specified

 

:https://pypi.python.org/pypi/MySQL-python/

下載MySQL-python-1.2.5.zip 檔案之後直接解壓。進入MySQL-python-1.2.5目錄:

>>python setup.py install

 

解決方案:

其實分析代碼,發現只是尋找mysql的安裝地址而已  修改setup_windows.py如下

註解兩行,加入一行,為第一步mysql的安裝位置

 

   #serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE,options[‘registry_key‘] )

   #mysql_root, dummy = _winreg.QueryValueEx(serverKey,‘Location‘)

   mysql_root = r"F:\devtools\MySQL\MySQL Server 5.5"

 

然後報錯: Unable to find vcvarsall.bat

 

最後去

加州大學 歐文分校的Christoph Gohlke提供了大量python非官方 外掛程式模組安裝包:
www.lfd.uci.edu/~gohlke/pythonlibs/





python 安裝 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.