View Post


解决win10安装flask-mysqldb报错 Python2.7

win10上安装的pycharm,在pycharm创建的py2.7虚拟环境中安装flask-sqlalchemy

执行pip install flask-mysqldb报错
error: Microsoft Visual C++ 9.0 is required. Get it from http://ak
a.ms/vcpython27

到报错链接下载该文件,然后安装后,仍然报错
Building wheel for mysqlclient (setup.py) … error
ERROR: Command errored out with exit status 1:
command: ‘e:\code\myscripts\virtualenv\scripts\python.exe’ -u -c ‘i
mport sys, setuptools, tokenize; sys.argv[0] = ‘”‘”‘c:\users\admini~
1\appdata\local\temp\pip-install-nuo20j\mysqlclient\setup.py'”‘”
‘; file='”‘”‘c:\users\admini~1\appdata\local\tem

解决办法:
https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python
下载mysqlclient‑1.4.6‑cp27‑cp27m‑win_amd64.whl(根据自己py版本及电脑配置下载)
pip install mysqlclient‑1.4.6‑cp27‑cp27m‑win_amd64.whl

成功后执行pip install flask-mysqldb

至此完成

版权声明:本文为yungjinzhou原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/yungjinzhou/p/win10_py2_install_mysqldb.html