python - 在 Windows 10 中安装 mysqlclient 或/和 mysql-python 时出错
问题描述
我在 Windows 10 Home 的文件夹中正确安装了 Django,我需要将此应用程序与 Mysql 连接。当我执行 pip install mysqlclient 或/和 mysql-python 我有这个错误。
_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\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
----------------------------------------
Command "c:\xampp\htdocs\worldfeeding\env\scripts\python.exe -u -c "import
setuptools, tokenize;__file__='C:\\Users\\user\\AppData\\Local\\Temp\\pip-install-ceju8r0r\\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\user\AppData\Local\Temp\pip-record-r4bwaq6w\install-record.txt --single-version-externally-managed --compile --install-headers c:\xampp\htdocs\worldfeeding\env\include\site\python3.7\mysqlclient" failed with error code 1 in C:\Users\user\AppData\Local\Temp\pip-install-ceju8r0r\mysqlclient\
搜索,我尝试了以下答案中的解决方案:
但不工作。
因此,我按照这些链接中答案的说明安装了 Visual Studio Community 2017 的 paquets,但无法正常工作。
我用 mysql 服务器安装了 mysql-web-community。
我下载了 VS 和 Twisted-18.4.0-cp36-cp36m-win32.whl 但无法正常工作。
我尝试使用 npm install --global --production windows-build-tools 并没有。
有人可以帮助我吗?
解决方案
推荐阅读
- javascript - How to use emojionearea library in webpack
- javascript - json-server 未显示 JSON 数据的 URL
- python - 用 Python 写一个 excel 文件
- pandas - 给定特定值订购 seaborn heatmap xticks
- python - 如何使用 tweepy 发布图片、回复和转发?
- java - Docker 文件 ENV 变量替换
- powerbi - Power BI Workspace - 数据集凭据补丁收到 401 Unauthorized
- ruby-on-rails - 当用户使用以 HTTPS 为前缀的根域名时,如何确保我的网站能够加载?
- azure-devops - Azure Pipelines:任务组的条件运行
- python - 在嵌套字典中查找键的对应值