Rux*_*ima 5 python mysql django pip
我有一个使用 Python 3.8 的 django 项目,我尝试通过以下命令安装mysqlclient库:pip install mysqlclient
我收到这个错误:
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
Run Code Online (Sandbox Code Playgroud)
*...is not a supported wheel on this platform.*
python setup.py install
,出现相同的错误: 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
Run Code Online (Sandbox Code Playgroud)
我尝试了这个命令pip install --only-binary :all: mysqlclient
,但收到错误:
无法找到满足 mysqlclient 要求的版本(来自版本:)未找到 mysqlclient 的匹配发行版
如果您有任何建议,请告诉我。谢谢你!
Cannot open include file: 'mysql.h': No such file or directory
从源代码编译时,您缺少mysql
所需的库mysqlclient
。
此平台不支持滚轮
我打赌你已经安装了 32 位 python。pypi 上的所有 whl 文件mysqlclient
均适用于 amd64,这可以解释为什么您的设置没有受支持的版本。您可以通过以下方式检查:
python38-32
,那么你肯定是32位版本python
并cmd
检查第一行。对于我(64 位 python),它包含字符串MSC v.1915 64 bit (AMD64)
您可以做的就是卸载 32 位版本并安装 64 位版本,毕竟这mysqlclient
不会是 pypi 上没有可用的 32 位 whl 文件的最后一个工具,或者您可以从mysqlclient
此处下载32 位 whl 文件
归档时间: |
|
查看次数: |
12063 次 |
最近记录: |