发布于 4年前
安装Flask-MySQLdb报错:Cannot open include file: 'mysql.h'
python2安装Flask-MySQLdb出现 fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory。解决方案如下:
(1)登录网址https://www.lfd.uci.edu/~gohl...,下载相应的包;
(2)先安装MySQL-python,即在上述网站下载MySQL_python‑1.2.5‑cp27‑none‑win32.whl,64位的话下载MySQL_python‑1.2.5‑cp27‑none‑win_amd64.whl,然后pip安装;
(3)然后安装mysqlclient,下载对应版本的whl文件,我用的是mysqlclient‑1.3.12‑cp27‑cp27m‑win32.whl,然后pip安装
(4)之后再pip Flask-MySQLdb就报成功啦~~