错误具体内容如下:

    _mysql.c(29) : fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory
    error: command 'C:\\Users\\Administrator\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2

弄了两个多小时,才弄好,整理了一下解决办法如下:(我的环境是win7 64位系统,python2.7 32位版本)

1.先贴个网站https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python,东西都在这个网站下就行

2.先安装MySQL-python,即在上述网站下载MySQL_python‑1.2.5‑cp27‑none‑win32.whl,64位的话下载MySQL_python‑1.2.5‑cp27‑none‑win_amd64.whl,然后pip即可(不会pip的同学自行百度一下这个吧)

3.然后安装mysqlclient,下载对应版本的whl文件,我用的是mysqlclient‑1.3.12‑cp27‑cp27m‑win32.whl,然后pip

4.之后再pip Flask-MySQLdb即可

5.最后贴一下我成功图,预祝大家成功

python2安装Flask-MySQLdb出现 fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory

 

相关文章:

  • 2021-08-28
  • 2022-12-23
  • 2022-01-10
  • 2022-12-23
  • 2021-07-30
  • 2022-12-23
  • 2021-05-01
猜你喜欢
  • 2022-02-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案