安裝MySQL-python報錯比較多,但不關mysql的事
Windows下安裝MySQLdb遇到的問題及解決方法
>pip install MySQL-python
error: Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat).
Get it from http://aka.ms/vcpython27
----------------------------------------
按上面提示到http://aka.ms/vcpython27下載下傳安裝後執行VCForPython27.msi後仍然報下面的錯誤:
_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h':
No such file or directory
error: command 'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Common\\
Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit
status 2
---------------------------------------
解決辦法:搜尋或者到下面網址下載下傳安裝:MySQL-python-1.2.3.win-amd64-py2.7.exe
MySQL-python 1.2.3 for Windows and Python 2.7, 32bit and 64bit versions | codegood
http://www.codegood.com/archives/129
安裝後再用pip指令提示已經安裝了
C:\Users\Administrator>pip install MySQL-python
Requirement already satisfied (use --upgrade to upgrade): MySQL-python in d:\pyt
hon27\lib\site-packages
在pycharm裡 File -> Settings -> Python interpreter 裡面添加MySQL-python就可以了
=======================================
下面是設定的截圖:
如果配置成功後仍然報錯,那麼就重新開機電腦,再不行,就把電腦砸了吧,哈哈哈哈