问题:
ERROR: Command errored out with exit status 1: command: 'C:ProgramDataanaconda3envsflask_learnpython.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\sewen\AppData\Local\Temp\pip-install-nyi1 a5bp\mysqlclient\setup.py'"'"'; __file__='"'"'C:\Users\sewen\AppData\Local\Temp\pip-install-nyi1a5bp\mysqlclient\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file __);code=f.read().replace('"'"' '"'"', '"'"' '"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UserssewenAppDataLocalTemppip-record-e8inmf7e install-record.txt' --single-version-externally-managed --compile --install-headers 'C:ProgramDataanaconda3envsflask_learnIncludemysqlclient' cwd: C:UserssewenAppDataLocalTemppip-install-nyi1a5bpmysqlclient Complete output (30 lines): running install running build running build_py creating build creating buildlib.win-amd64-3.6 copying _mysql_exceptions.py -> buildlib.win-amd64-3.6 creating buildlib.win-amd64-3.6MySQLdb copying MySQLdb\__init__.py -> buildlib.win-amd64-3.6MySQLdb copying MySQLdbcompat.py -> buildlib.win-amd64-3.6MySQLdb copying MySQLdbconnections.py -> buildlib.win-amd64-3.6MySQLdb copying MySQLdbconverters.py -> buildlib.win-amd64-3.6MySQLdb copying MySQLdbcursors.py -> buildlib.win-amd64-3.6MySQLdb copying MySQLdb elease.py -> buildlib.win-amd64-3.6MySQLdb copying MySQLdb imes.py -> buildlib.win-amd64-3.6MySQLdb creating buildlib.win-amd64-3.6MySQLdbconstants copying MySQLdbconstants\__init__.py -> buildlib.win-amd64-3.6MySQLdbconstants copying MySQLdbconstantsCLIENT.py -> buildlib.win-amd64-3.6MySQLdbconstants copying MySQLdbconstantsCR.py -> buildlib.win-amd64-3.6MySQLdbconstants copying MySQLdbconstantsER.py -> buildlib.win-amd64-3.6MySQLdbconstants copying MySQLdbconstantsFIELD_TYPE.py -> buildlib.win-amd64-3.6MySQLdbconstants copying MySQLdbconstantsFLAG.py -> buildlib.win-amd64-3.6MySQLdbconstants copying MySQLdbconstantsREFRESH.py -> buildlib.win-amd64-3.6MySQLdbconstants running build_ext building '_mysql' extension creating build emp.win-amd64-3.6 creating build emp.win-amd64-3.6Release C:Program Files (x86)Microsoft Visual Studio 14.0VCBINx86_amd64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Dversion_info=(1,3,13,'final',0) -D__version__=1.3.13 "-IC:Program Files (x86)MySQLMySQL Connector C 6.1include" -IC:ProgramDataanaconda3envsflask_learninclude -IC:ProgramDataanaconda3envsflask_learninclude "-IC:Program Files (x86)Micros oft Visual Studio 14.0VCINCLUDE" "-IC:Program Files (x86)Windows Kits10include10.0.10240.0ucrt" "-IC:Program Files (x86)Windows Kits8.1includeshared" "-IC:Program Files (x 86)Windows Kits8.1includeum" "-IC:Program Files (x86)Windows Kits8.1includewinrt" /Tc_mysql.c /Fobuild emp.win-amd64-3.6Release\_mysql.obj /Zl _mysql.c _mysql.c(29): fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe' failed with exit status 2 ---------------------------------------- Rolling back uninstall of mysqlclient Moving to c:programdataanaconda3envsflask_learnlibsite-packagesmysqlclient-2.0.1.dist-info from c:programdataanaconda3envsflask_learnlibsite-packages~ysqlclient-2.0.1.dist-info Moving to c:programdataanaconda3envsflask_learnlibsite-packagesmysqldb from c:programdataanaconda3envsflask_learnlibsite-packages~ysqldb ERROR: Command errored out with exit status 1: 'C:ProgramDataanaconda3envsflask_learnpython.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\sewen\AppDa ta\Local\Temp\pip-install-nyi1a5bp\mysqlclient\setup.py'"'"'; __file__='"'"'C:\Users\sewen\AppData\Local\Temp\pip-install-nyi1a5bp\mysqlclient\setup.py'"'"';f=getattr(token ize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"' '"'"', '"'"' '"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UserssewenAppDat aLocalTemppip-record-e8inmf7einstall-record.txt' --single-version-externally-managed --compile --install-headers 'C:ProgramDataanaconda3envsflask_learnIncludemysqlclient' Chec k the logs for full command output.
搜索初步判断是因为mysqlclient==1.3.13不支持windows下python3.6环境,升级到了1.4.6版本,更新后可以正常运行;