无法打开 源 文件 mysql.h_python - 无法打开包含文件:'mysql.h':没有这样的文件或目录 - 堆栈内存溢出...

我正在尝试安装Django项目的requirements.txt,它给了我以下错误:

MySQLdb / _mysql.c(29):致命错误C1083:无法打开包含文件:'mysql.h':无此类文件或目录

我尝试了以下命令,但它们似乎对我不起作用

我尝试过的命令:

pip install mysqlclient==1.3.4

pip install --only-binary :all: mysqlclient

错误:

Installing collected packages: mysqlclient, wheel, gunicorn, psycopg2, python-dateutil, numpy, pandas, django-pandas, kuchbhi, pyparsing, pulp, sqlalchemy, xlwt, django-bootstrap-modal-forms, MarkupSafe, jinja2, branca, certifi, urllib3, chardet, idna, requests, folium, django-widget-tweaks, googlemaps, decorator, ipython-genutils, traitlets, pywin32, jupyter-core, pyrsistent, attrs, more-itertools, zipp, importlib-metadata, jsonschema, nbformat, pyzmq, tornado, jupyter-client, pickleshare, backcall, parso, jedi, wcwidth, prompt-toolkit, colorama, pygments, ipython, ipykernel, testpath, defusedxml, pandocfilters, webencodings, bleach, mistune, entrypoints, nbconvert, pywinpty, terminado, Send2Trash, prometheus-client, notebook, widgetsnbextension, ipywidgets, geojson, gmaps, django-fullcalendar, geographiclib, geopy, pillow, brotli, django-brotli, zopfli, django-static-compress, django-clear-cache, pyjwt, djangorestframework, djangorestframework-simplejwt, djangorestframework-jwt, django-cors-headers

Found existing installation: mysqlclient 1.3.12

Uninstalling mysqlclient-1.3.12:

Successfully uninstalled mysqlclient-1.3.12

Running setup.py install for mysqlclient ... error

Complete output from command c:\users\rahul\appdata\local\programs\python\python36-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Rahul\\AppData\\Local\\Temp\\pip-build-pul5j4z0\\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\Rahul\AppData\Local\Temp\pip-mn6g7opp-record\install-record.txt --single-version-externally-managed --compile:

c:\users\rahul\appdata\local\programs\python\python36-32\lib\distutils\dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type'

warnings.warn(msg)

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\compat.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

running build_ext

building 'MySQLdb._mysql' extension

creating build\temp.win32-3.6

creating build\temp.win32-3.6\Release

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

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -Dversion_info=(1,4,1,'final',0) -D__version__=1.4.1 "-IC:\Program Files (x86)\MySQL\MySQL Connector C 6.1\include\mariadb" -Ic:\users\rahul\appdata\local\programs\python\python36-32\include -Ic:\users\rahul\appdata\local\programs\python\python36-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt" /TcMySQLdb/_mysql.c /Fobuild\temp.win32-3.6\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\\2019\\Community\\VC\\Tools\\MSVC\\14.23.28105\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2

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

Rolling back uninstall of mysqlclient

Command "c:\users\rahul\appdata\local\programs\python\python36-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Rahul\\AppData\\Local\\Temp\\pip-build-pul5j4z0\\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\Rahul\AppData\Local\Temp\pip-mn6g7opp-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Rahul\AppData\Local\Temp\pip-build-pul5j4z0\mysqlclient\

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值