apache mysql python win10_Win10 MySQL-python
在Windows 下調試 Python 還是挺麻煩的.通過PyCharm 來安裝個MySQL-python 的庫都搞了大半天.分別嘗試 1.2.3,1.2.4和1.2.5都有不同的錯誤.需要解決的問題就是這個:“Cannot open include file: 'config-win.h': No such file or directory” while installing mysql-python"
安裝步驟如下:
安裝 Microsoft Visual C++ Compiler Package for Python 2.7
點擊鏈接
默認安裝的路徑C:\Users\admin\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\
安裝 MySQL Connector C 6.0.2
點擊鏈接
也可以下載MYSQL的官方工具安裝:
下載 MySQL-python 1.2.5 源碼包
點擊鏈接
解壓源碼包后,修改 site.cfg 文件。
實際上,如果你是在32 位系統上部署,那么通過pip install 安裝MySQL-python 1.2.5 只需進行上面的依賴包安裝即可。
但在 64 位環境中,就會提示“Cannot open include file: 'config-win.h'” 的錯誤。
原因就是 site.cfg 中寫的 MySQL Connector C 為32 位版本。
原來的 site.cfg 文件內容如下:
# http://stackoverflow.com/questions/1972259/mysql-python-install-problem-using-virtualenv-windows-pip
# Windows connector libs for MySQL. You need a 32-bit connector for your 32-bit Python build.
connector = C:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2
修改為:
connector = C:\Program Files\MySQL\MySQL Connector C 6.0.2
PS: pycrypto
點擊鏈接
總結
以上是生活随笔為你收集整理的apache mysql python win10_Win10 MySQL-python的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: oauth2基本概念
- 下一篇: 动软代码生成器生成数据库文档问题