ERROR: Could not build wheels for mysqlclient, which is required to install pyproject.toml-based pro

1 Python 3.7.4 下,安装 mysqlclient 2.0.2 版本报错

 /usr/local/python3/bin/pip3 install mysqlclient==2.0.2
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Collecting mysqlclient==2.0.2
  Using cached http://mirrors.aliyun.com/pypi/packages/0e/68/f79de0e0fcdb041783124b825771e0ba6a3d0893b7b4c4735f130e42af47/mysqlclient-2.0.2.tar.gz (88 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: mysqlclient
  Building wheel for mysqlclient (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for mysqlclient (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [31 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-37
      creating build/lib.linux-x86_64-cpython-37/MySQLdb
      copying MySQLdb/__init__.py -> build/lib.linux-x86_64-cpython-37/MySQLdb
      copying MySQLdb/_exceptions.py -> build/lib.linux-x86_64-cpython-37/MySQLdb
      copying MySQLdb/connections.py -> build/lib.linux-x86_64-cpython-37/MySQLdb
      copying MySQLdb/converters.py -> build/lib.linux-x86_64-cpython-37/MySQLdb
      copying MySQLdb/cursors.py -> build/lib.linux-x86_64-cpython-37/MySQLdb
      copying MySQLdb/release.py -> build/lib.linux-x86_64-cpython-37/MySQLdb
      copying MySQLdb/times.py -> build/lib.linux-x86_64-cpython-37/MySQLdb
   MySQLdb/_mysql.c:1340:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
           for (unsigned int i=0; i<n; i++) {
           ^
      MySQLdb/_mysql.c:1340:5: note: use option -std=c99 or -std=gnu99 to compile your code
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for mysqlclient
Failed to build mysqlclient
ERROR: Could not build wheels for mysqlclient, which is required to install pyproject.toml-based projects

2 python 3.7.4 与mysqlclient 2.0.2 不兼容,安装高版本

/usr/local/python3/bin/pip3 install mysqlclient==2.1.1
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Collecting mysqlclient==2.1.1
  Downloading http://mirrors.aliyun.com/pypi/packages/50/5f/eac919b88b9df39bbe4a855f136d58f80d191cfea34a3dcf96bf5d8ace0a/mysqlclient-2.1.1.tar.gz (88 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 88.1/88.1 kB 1.9 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: mysqlclient
  Building wheel for mysqlclient (pyproject.toml) ... done
  Created wheel for mysqlclient: filename=mysqlclient-2.1.1-cp37-cp37m-linux_x86_64.whl size=99123 sha256=a2185f340899c8241c61255a9fb172318ca0c8d821c941797ff5d18d3f4a875c
  Stored in directory: /root/.cache/pip/wheels/b8/f9/7d/9c1d88ddeaad8b2002980d45158b426b5943a1391249e42ec5
Successfully built mysqlclient

 #查看安装包

/usr/local/python3/bin/pip3 list| grep  mysqlclient
mysqlclient            2.1.1

3 windows 下面 ,下载之后安装

方便下载,特提供网盘

链接:https://pan.baidu.com/s/1gDy6rDpYDfEKqFB8H4sVvQ

提取码:mu38

pip isntall mysqlclient-2.0.2-cp37-cp37m-win_amd64.whl

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值