mysqlclient报错
ERROR: Command errored out with exit status 1:
command: 'e:\git\testkiss\pipenv_venv_in_project\testkiss-3ydqnaio\scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\JIATEN~1\\AppData\\Local\\Temp\\pip-install-we9phtm6\\mysqlclient_79864224cca444bdaa87d5975890a8b6\\setup.py'"'"'; __file__='"'"'C:\\Users\\JIATEN~1\\AppData\\Local\\Temp\\pip-install-we9phtm6\\mysqlclient_79864224cca444bdaa87d5975890a8b6\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\JIATEN~1\AppData\Local\Temp\pip-wheel-tc5a62gs'
cwd: C:\Users\JIATEN~1\AppData\Local\Temp\pip-install-we9phtm6\mysqlclient_79864224cca444bdaa87d5975890a8b6\
Complete output (25 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win32-3.6
creating build\lib.win32-3.6\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\_exceptions.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\connections.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\converters.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\release.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\times.py -> build\lib.win32-3.6\MySQLdb
creating build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.6\MySQLdb\constants
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
building 'MySQLdb._mysql' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Failed building wheel for mysqlclient
ERROR: Command errored out with exit status 1:
command: 'e:\git\testkiss\pipenv_venv_in_project\testkiss-3ydqnaio\scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\JIATEN~1\\AppData\\Local\\Temp\\pip-install-we9phtm6\\mysqlclient_79864224cca444bdaa87d5975890a8b6\\setup.py'"'"'; __file__='"'"'C:\\Users\\JIATEN~1\\AppData\\Local\\Temp\\pip-install-we9phtm6\\mysqlclient_79864224cca444bdaa87d5975890a8b6\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\JIATEN~1\AppData\Local\Temp\pip-record-g54135n_\install-record.txt' --single-version-externally-managed --compile --install-headers 'e:\git\testkiss\pipenv_venv_in_project\testkiss-3ydqnaio\include\site\python3.6\mysqlclient'
cwd: C:\Users\JIATEN~1\AppData\Local\Temp\pip-install-we9phtm6\mysqlclient_79864224cca444bdaa87d5975890a8b6\
Complete output (25 lines):
running install
running build
running build_py
creating build
creating build\lib.win32-3.6
creating build\lib.win32-3.6\MySQLdb
copying MySQLdb\__init__.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\_exceptions.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\connections.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\converters.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\cursors.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\release.py -> build\lib.win32-3.6\MySQLdb
copying MySQLdb\times.py -> build\lib.win32-3.6\MySQLdb
creating build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\__init__.py -> build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\CR.py -> build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\ER.py -> build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.6\MySQLdb\constants
copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.6\MySQLdb\constants
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
building 'MySQLdb._mysql' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Command errored out with exit status 1: 'e:\git\testkiss\pipenv_venv_in_project\testkiss-3ydqnaio\scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\JIATEN~1\\AppData\\Local\\Temp\\pip-install-we9phtm6\\mysqlclient_79864224cca444bdaa87d5975890a8b6\\setup.py'"'"'; __file__='"'"'C:\\Users\\JIATEN~1\\AppData\\Local\\Temp\\pip-install-we9phtm6\\mysqlclient_79864224cca444bdaa87d5975890a8b6\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\JIATEN~1\AppData\Local\Temp\pip-record-g54135n_\install-record.txt' --single-version-externally-managed --compile --install-headers 'e:\git\testkiss\pipenv_venv_in_project\testkiss-3ydqnaio\include\site\python3.6\mysqlclient' Check the logs for full command output.
正在回答 回答被采纳积分+1
同学,你好!使用pip命令安装mysqlclient大多数情况下是会报错的,同学可尝试以下安装方法:
1、先查看一下电脑中的Python版本,然后下载对应版本的mysqlclient,链接:https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient

2、进入到下载目录,执行命令pip install mysqlclient-xxx.whl进行安装
祝:学习愉快!
- 参与学习 人
- 提交作业 218 份
- 解答问题 3562 个
本阶段带你用Python开发一个网站,学习主流框架Django+Flask是Python Web开发的第一步,在基础知识上实现积分商城的项目开发,体验真实的项目开发流程,提高解决编程问题和效率的能力。
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星