会员可以在此提问,百战程序员老师有问必答
对大家有帮助的问答会被标记为“推荐”
看完课程过来浏览一下别人提的问题,会帮你学得更全面
截止目前,同学们一共提了 133037个问题
Python 全系列/第一阶段:Python入门/面向对象 23597楼
Python 全系列/第八阶段:轻量级Web开发利器-Flask框架/Flask高级 23599楼
JAVA 全系列/第二阶段:JAVA 基础深化和提高/XML 技术(旧) 23600楼
Python 全系列/第八阶段:轻量级Web开发利器-Flask框架/Ajax 23601楼
JAVA 全系列/第二阶段:JAVA 基础深化和提高/容器(旧) 23602楼
Python 全系列/第一阶段:Python入门/编程基本概念 23603楼
Python 全系列/第十四阶段:Python 爬虫开发/移动端爬虫开发- 23604楼
JAVA 全系列/第三阶段:数据库编程/MySQL数据库 23605楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/初识CSS 23607楼
Python 全系列/第一阶段:Python入门/序列 23609楼

C:\Windows\system32>workon django_env

(django_env) C:\Windows\System32>pip install mysqlclient

Collecting mysqlclient

  Using cached mysqlclient-1.4.6.tar.gz (85 kB)

Building wheels for collected packages: mysqlclient

  Building wheel for mysqlclient (setup.py) ... error

  ERROR: Command errored out with exit status 1:

   command: 'D:\python_env\django_env\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Jace\\AppData\\Local\\Temp\\pip-install-v7ymmrjl\\mysqlclient\\setup.py'"'"'; __file__='"'"'C:\\Users\\Jace\\AppData\\Local\\Temp\\pip-install-v7ymmrjl\\mysqlclient\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Jace\AppData\Local\Temp\pip-wheel-qh9stb47'

       cwd: C:\Users\Jace\AppData\Local\Temp\pip-install-v7ymmrjl\mysqlclient\

  Complete output (30 lines):

  running bdist_wheel

  running build

  running build_py

  creating build

  creating build\lib.win32-3.8

  creating build\lib.win32-3.8\MySQLdb

  copying MySQLdb\__init__.py -> build\lib.win32-3.8\MySQLdb

  copying MySQLdb\_exceptions.py -> build\lib.win32-3.8\MySQLdb

  copying MySQLdb\compat.py -> build\lib.win32-3.8\MySQLdb

  copying MySQLdb\connections.py -> build\lib.win32-3.8\MySQLdb

  copying MySQLdb\converters.py -> build\lib.win32-3.8\MySQLdb

  copying MySQLdb\cursors.py -> build\lib.win32-3.8\MySQLdb

  copying MySQLdb\release.py -> build\lib.win32-3.8\MySQLdb

  copying MySQLdb\times.py -> build\lib.win32-3.8\MySQLdb

  creating build\lib.win32-3.8\MySQLdb\constants

  copying MySQLdb\constants\__init__.py -> build\lib.win32-3.8\MySQLdb\constants

  copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.8\MySQLdb\constants

  copying MySQLdb\constants\CR.py -> build\lib.win32-3.8\MySQLdb\constants

  copying MySQLdb\constants\ER.py -> build\lib.win32-3.8\MySQLdb\constants

  copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.8\MySQLdb\constants

  copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.8\MySQLdb\constants

  running build_ext

  building 'MySQLdb._mysql' extension

  creating build\temp.win32-3.8

  creating build\temp.win32-3.8\Release

  creating build\temp.win32-3.8\Release\MySQLdb

  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Dversion_info=(1,4,6,'final',0) -D__version__=1.4.6 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.1\include\mariadb" -ID:\python_env\django_env\include -Id:\python3.8.2\include -Id:\python3.8.2\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /TcMySQLdb/_mysql.c /Fobuild\temp.win32-3.8\Release\MySQLdb/_mysql.obj /Zl /D_CRT_SECURE_NO_WARNINGS

  _mysql.c

  MySQLdb/_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\\cl.exe' failed with exit status 2

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

  ERROR: Failed building wheel for mysqlclient

  Running setup.py clean for mysqlclient

Failed to build mysqlclient

Installing collected packages: mysqlclient

    Running setup.py install for mysqlclient ... error

    ERROR: Command errored out with exit status 1:

     command: 'D:\python_env\django_env\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Jace\\AppData\\Local\\Temp\\pip-install-v7ymmrjl\\mysqlclient\\setup.py'"'"'; __file__='"'"'C:\\Users\\Jace\\AppData\\Local\\Temp\\pip-install-v7ymmrjl\\mysqlclient\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Jace\AppData\Local\Temp\pip-record-c_7pdi53\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\python_env\django_env\include\site\python3.8\mysqlclient'

         cwd: C:\Users\Jace\AppData\Local\Temp\pip-install-v7ymmrjl\mysqlclient\

    Complete output (30 lines):

    running install

    running build

    running build_py

    creating build

    creating build\lib.win32-3.8

    creating build\lib.win32-3.8\MySQLdb

    copying MySQLdb\__init__.py -> build\lib.win32-3.8\MySQLdb

    copying MySQLdb\_exceptions.py -> build\lib.win32-3.8\MySQLdb

    copying MySQLdb\compat.py -> build\lib.win32-3.8\MySQLdb

    copying MySQLdb\connections.py -> build\lib.win32-3.8\MySQLdb

    copying MySQLdb\converters.py -> build\lib.win32-3.8\MySQLdb

    copying MySQLdb\cursors.py -> build\lib.win32-3.8\MySQLdb

    copying MySQLdb\release.py -> build\lib.win32-3.8\MySQLdb

    copying MySQLdb\times.py -> build\lib.win32-3.8\MySQLdb

    creating build\lib.win32-3.8\MySQLdb\constants

    copying MySQLdb\constants\__init__.py -> build\lib.win32-3.8\MySQLdb\constants

    copying MySQLdb\constants\CLIENT.py -> build\lib.win32-3.8\MySQLdb\constants

    copying MySQLdb\constants\CR.py -> build\lib.win32-3.8\MySQLdb\constants

    copying MySQLdb\constants\ER.py -> build\lib.win32-3.8\MySQLdb\constants

    copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win32-3.8\MySQLdb\constants

    copying MySQLdb\constants\FLAG.py -> build\lib.win32-3.8\MySQLdb\constants

    running build_ext

    building 'MySQLdb._mysql' extension

    creating build\temp.win32-3.8

    creating build\temp.win32-3.8\Release

    creating build\temp.win32-3.8\Release\MySQLdb

    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Dversion_info=(1,4,6,'final',0) -D__version__=1.4.6 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.1\include\mariadb" -ID:\python_env\django_env\include -Id:\python3.8.2\include -Id:\python3.8.2\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /TcMySQLdb/_mysql.c /Fobuild\temp.win32-3.8\Release\MySQLdb/_mysql.obj /Zl /D_CRT_SECURE_NO_WARNINGS

    _mysql.c

    MySQLdb/_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\\cl.exe' failed with exit status 2

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

ERROR: Command errored out with exit status 1: 'D:\python_env\django_env\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Jace\\AppData\\Local\\Temp\\pip-install-v7ymmrjl\\mysqlclient\\setup.py'"'"'; __file__='"'"'C:\\Users\\Jace\\AppData\\Local\\Temp\\pip-install-v7ymmrjl\\mysqlclient\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Jace\AppData\Local\Temp\pip-record-c_7pdi53\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\python_env\django_env\include\site\python3.8\mysqlclient' Check the logs for full command output.




安装mysqlclient报错

Python 全系列/第十二阶段:Python_Django3框架/Django初级 23610楼

课程分类

百战程序员微信公众号

百战程序员微信小程序

©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园
网站维护:百战汇智(北京)科技有限公司
京公网安备 11011402011233号    京ICP备18060230号-3    营业执照    经营许可证:京B2-20212637