如何在安装mysqlclient的过程中修复“退出状态2失败”

时间:2019-02-10 12:36:35

标签: django python-3.x mysql-python

我遇到这样的错误,我的目标是在Django项目中安装mysqlclient以便连接到mysql数据库

pip安装mysqlclient

  

pip安装mysqlclient   收集mysqlclient     使用缓存的https://files.pythonhosted.org/packages/73/79/67ddf24ac31b05d741f0ac87fa612c7a11bab1b39b8270ed7344d149f8af/mysqlclie   nt-1.4.2.tar.gz   安装收集的软件包:mysqlclient     正在运行setup.py install for mysqlclient ...错误       来自命令c:\ users \ grey-space \ appdata \ local \ programs \ python \ python37-32 \ python.exe -u -c“ import setuptools的完整输出,    tokenize; 文件 ='C:\ Users \ GREY-S〜1 \ AppData \ Local \ Temp \ pip-install-07aotna9 \ mysqlclient \ setup.py'; f = getattr(tokenize,'op   en',打开)(文件);代码= f.read()。replace('\ r \ n','\ n'); f.close(); exec(compile(code ,文件,“ exec”))”安装-记录C:\ Users   \ GREY-S〜1 \ AppData \ Local \ Temp \ pip-record-f6xsvf5v \ install-record.txt-单一版本-外部管理-编译:       运行安装       运行构建       运行build_py       创建版本       创建build \ lib.win32-3.7       创建build \ lib.win32-3.7 \ MySQLdb       复制MySQLdb__init__.py-> build \ lib.win32-3.7 \ MySQLdb       复制MySQLdb_exceptions.py-> build \ lib.win32-3.7 \ MySQLdb       复制MySQLdb \ compat.py-> build \ lib.win32-3.7 \ MySQLdb       复制MySQLdb \ connections.py-> build \ lib.win32-3.7 \ MySQLdb       复制MySQLdb \ converters.py-> build \ lib.win32-3.7 \ MySQLdb       复制MySQLdb \ cursors.py-> build \ lib.win32-3.7 \ MySQLdb       复制MySQLdb \ release.py-> build \ lib.win32-3.7 \ MySQLdb       复制MySQLdb \ times.py-> build \ lib.win32-3.7 \ MySQLdb       创建build \ lib.win32-3.7 \ MySQLdb \ constants       复制MySQLdb \ constants__init __。py-> build \ lib.win32-3.7 \ MySQLdb \ constants       复制MySQLdb \ constants \ CLIENT.py-> build \ lib.win32-3.7 \ MySQLdb \ constants       复制MySQLdb \ constants \ CR.py-> build \ lib.win32-3.7 \ MySQLdb \ constants       复制MySQLdb \ constants \ ER.py-> build \ lib.win32-3.7 \ MySQLdb \ constants       复制MySQLdb \ constants \ FIELD_TYPE.py-> build \ lib.win32-3.7 \ MySQLdb \ constants       复制MySQLdb \ constants \ FLAG.py-> build \ lib.win32-3.7 \ MySQLdb \ constants       运行build_ext       构建'MySQLdb._mysql'扩展       创建build \ temp.win32-3.7       创建build \ temp.win32-3.7 \ Release       创建build \ temp.win32-3.7 \ Release \ MySQLdb       C:\ Program Files(x86)\ Microsoft Visual Studio \ 2017 \ Community \ VC \ Tools \ MSVC \ 14.16.27023 \ bin \ HostX86 \ x86 \ cl.exe / c / nologo / Ox /   W3 / GL / DNDEBUG / MD -Dversion_info =(1,4,2,'final',0)-D__version __ = 1.4.2“ -IC:\ Program Files(x86)\ MySQL \ MySQL Connector C 6.1 \ incl   ude \ mariadb“ -Ic:\ users \灰色空间\ appdata \ local \ programs \ python \ python37-32 \ include -Ic:\ users \灰色空间\ appdata \ local \ programs \ p   ython \ python37-32 \ include“ -IC:\ Program Files(x86)\ Microsoft Visual Studio \ 2017 \ Community \ VC \ Tools \ MSVC \ 14.16.27023 \ ATLMFC \ include   “” -IC:\ Program文件(x86)\ Microsoft Visual Studio \ 2017 \ Community \ VC \ Tools \ MSVC \ 14.16.27023 \ include“” -IC:\ Program文件(x86)\ Win   dows Kits \ NETFXSDK \ 4.6.1 \ include \ um“” -IC:\ Program Files(x86)\ Windows Kits \ 10 \ include \ 10.0.17763.0 \ ucrt“” -IC:\ Program Files(x86)   \ Windows Kits \ 10 \ include \ 10.0.17763.0 \ shared“” -IC:\ Program Files(x86)\ Windows Kits \ 10 \ include \ 10.0.17763.0 \ um“” -IC:\ Program File   s(x86)\ Windows Kits \ 10 \ include \ 10.0.17763.0 \ winrt“” -IC:\ Program Files(x86)\ Windows Kits \ 10 \ include \ 10.0.17763.0 \ cppwinrt“ / TcMyS   QLdb / _mysql.c /Fobuild\temp.win32-3.7\Release\MySQLdb/_mysql.obj / Zl / D_CRT_SECURE_NO_WARNINGS       _mysql.c       MySQLdb / _mysql.c(29):致命错误C1083:无法打开包含文件:'mysql.h':无此类文件或目录       错误:命令'C:\ Program Files(x86)\ Microsoft Visual Studio \ 2017 \ Community \ VC \ Tools \ MSVC \ 14.16.27023 \ bin \ HostX86 \   x86 \ cl.exe'失败,退出状态为2

----------------------------------------

命令“ c:\ users \灰色空间\ appdata \ local \ programs \ python \ python37-32 \ python.exe -u -c”导入设置工具,标记化; 文件 ='C :\ Users \ GREY-S〜1 \ AppData \ Local \ Temp \ pip-install-07aotna9 \ mysqlclient \ setup.py'; f = getattr(tokenize,'open',open)( file );鳕鱼 e = f.read()。replace('\ r \ n','\ n'); f.close(); exec(compile(code, file ,'exec'))“安装--record C:\ Users \ GREY-S〜1 \ AppData \ Local \ Temp \ pip-record-f6xsvf5v \ install-record.txt-“单个版本-外部管理-编译”失败,错误代码为1:C:\ Users \ GRE Y-S〜1 \ AppData \ Local \ Temp \ pip-install-07aotna9 \ mysqlclient \

我预计已安装mysqlclient

0 个答案:

没有答案