【问题标题】:mysql-python install error: Cannot open include file: 'config-win.hmysql-python 安装错误:无法打开包含文件:'config-win.h
【发布时间】:2018-08-18 17:03:40
【问题描述】:

嗨,

我正在尝试pip install mysql-python,但我不断收到错误消息。我想知道是否有人知道我需要做什么才能使这项工作正常进行?

我使用的是 Windows 10、python 3.6 和 mysql 5.7。我是编码新手,所以如果我错过了什么,请告诉我。谢谢

这是我不断收到的错误:

_mysql.c(42):致命错误 C1083:无法打开包含文件: 'config-win.h': 没有这样的文件或目录

错误:命令'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\bin\HostX86\x64\cl .exe' 失败,退出状态为 2

【问题讨论】:

标签: python mysql django


【解决方案1】:

您可以使用https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient为您的python 版本下载非官方的Windows 二进制文件。然后使用pip 安装它。这样您就可以避免使用 Visual Studio 构建工具的麻烦。

只需下载最适合您的 mysqlclient.whl 文件(适用于 python 3 版本)。

我认为在你的情况下它会是

mysqlclient‑1.3.13‑cp36‑cp36m‑win32.whl(如果您的机器是 32 位) mysqlclient‑1.3.13‑cp36‑cp36m‑win_amd64.whl(如果您的机器是 64 位)

然后在命令提示符下,将位置更改为下载文件所在的目录,通过:

cd "the path to the downloaded file"

并运行文件:

pip install mysqlclient‑1.3.13‑cp36‑cp36m‑win_amd64.whl

【讨论】:

    猜你喜欢
    • 2015-01-08
    • 2010-12-30
    • 1970-01-01
    • 2018-07-29
    • 2020-02-29
    • 2018-12-09
    • 2014-12-07
    相关资源
    最近更新 更多