前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >【已解决】error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools

【已解决】error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools

作者头像
HammerZe
发布2022-05-09 18:53:33
6.9K0
发布2022-05-09 18:53:33
举报
文章被收录于专栏:Hammer随笔Hammer随笔

【已解决】error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

pip install mysqlclient报错

代码语言:javascript
复制
C:\Users\32972>pip install mysqlclient
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting mysqlclient
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/de/79/d02be3cb942afda6c99ca207858847572e38146eb73a7c4bfe3bdf154626/mysqlclient-2.1.0.tar.gz (87 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: mysqlclient
  Building wheel for mysqlclient (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'D:\Virtualenvs\luffy\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\32972\\AppData\\Local\\Temp\\pip-install-vp9aoqzy\\mysqlclient_f5d3756e23814b8baeb6ec13421de771\\setup.py'"'"'; __file__='"'"'C:\\Users\\32972\\AppData\\Local\\Temp\\pip-install-vp9aoqzy\\mysqlclient_f5d3756e23814b8baeb6ec13421de771\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\32972\AppData\Local\Temp\pip-wheel-gf2kbgzn'
       cwd: C:\Users\32972\AppData\Local\Temp\pip-install-vp9aoqzy\mysqlclient_f5d3756e23814b8baeb6ec13421de771\
  Complete output (23 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.6
  creating build\lib.win-amd64-3.6\MySQLdb
  copying MySQLdb\__init__.py -> build\lib.win-amd64-3.6\MySQLdb
  copying MySQLdb\_exceptions.py -> build\lib.win-amd64-3.6\MySQLdb
  copying MySQLdb\connections.py -> build\lib.win-amd64-3.6\MySQLdb
  copying MySQLdb\converters.py -> build\lib.win-amd64-3.6\MySQLdb
  copying MySQLdb\cursors.py -> build\lib.win-amd64-3.6\MySQLdb
  copying MySQLdb\release.py -> build\lib.win-amd64-3.6\MySQLdb
  copying MySQLdb\times.py -> build\lib.win-amd64-3.6\MySQLdb
  creating build\lib.win-amd64-3.6\MySQLdb\constants
  copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-3.6\MySQLdb\constants
  copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-3.6\MySQLdb\constants
  copying MySQLdb\constants\CR.py -> build\lib.win-amd64-3.6\MySQLdb\constants
  copying MySQLdb\constants\ER.py -> build\lib.win-amd64-3.6\MySQLdb\constants
  copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-3.6\MySQLdb\constants
  copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-3.6\MySQLdb\constants
  running build_ext
  building 'MySQLdb._mysql' extension
  error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
  ----------------------------------------
  ERROR: Failed building wheel for mysqlclient
  Running setup.py clean for mysqlclient
Failed to build mysqlclient
Installing collected packages: mysqlclient
    Running setup.py install for mysqlclient ... error
    ERROR: Command errored out with exit status 1:
     command: 'D:\Virtualenvs\luffy\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\32972\\AppData\\Local\\Temp\\pip-install-vp9aoqzy\\mysqlclient_f5d3756e23814b8baeb6ec13421de771\\setup.py'"'"'; __file__='"'"'C:\\Users\\32972\\AppData\\Local\\Temp\\pip-install-vp9aoqzy\\mysqlclient_f5d3756e23814b8baeb6ec13421de771\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\32972\AppData\Local\Temp\pip-record-thamcwpn\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\Virtualenvs\luffy\include\site\python3.6\mysqlclient'
         cwd: C:\Users\32972\AppData\Local\Temp\pip-install-vp9aoqzy\mysqlclient_f5d3756e23814b8baeb6ec13421de771\
    Complete output (25 lines):
    running install
    D:\Virtualenvs\luffy\lib\site-packages\setuptools\command\install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      setuptools.SetuptoolsDeprecationWarning,
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.6
    creating build\lib.win-amd64-3.6\MySQLdb
    copying MySQLdb\__init__.py -> build\lib.win-amd64-3.6\MySQLdb
    copying MySQLdb\_exceptions.py -> build\lib.win-amd64-3.6\MySQLdb
    copying MySQLdb\connections.py -> build\lib.win-amd64-3.6\MySQLdb
    copying MySQLdb\converters.py -> build\lib.win-amd64-3.6\MySQLdb
    copying MySQLdb\cursors.py -> build\lib.win-amd64-3.6\MySQLdb
    copying MySQLdb\release.py -> build\lib.win-amd64-3.6\MySQLdb
    copying MySQLdb\times.py -> build\lib.win-amd64-3.6\MySQLdb
    creating build\lib.win-amd64-3.6\MySQLdb\constants
    copying MySQLdb\constants\__init__.py -> build\lib.win-amd64-3.6\MySQLdb\constants
    copying MySQLdb\constants\CLIENT.py -> build\lib.win-amd64-3.6\MySQLdb\constants
    copying MySQLdb\constants\CR.py -> build\lib.win-amd64-3.6\MySQLdb\constants
    copying MySQLdb\constants\ER.py -> build\lib.win-amd64-3.6\MySQLdb\constants
    copying MySQLdb\constants\FIELD_TYPE.py -> build\lib.win-amd64-3.6\MySQLdb\constants
    copying MySQLdb\constants\FLAG.py -> build\lib.win-amd64-3.6\MySQLdb\constants
    running build_ext
    building 'MySQLdb._mysql' extension
    error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'D:\Virtualenvs\luffy\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\32972\\AppData\\Local\\Temp\\pip-install-vp9aoqzy\\mysqlclient_f5d3756e23814b8baeb6ec13421de771\\setup.py'"'"'; __file__='"'"'C:\\Users\\32972\\AppData\\Local\\Temp\\pip-install-vp9aoqzy\\mysqlclient_f5d3756e23814b8baeb6ec13421de771\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\32972\AppData\Local\Temp\pip-record-thamcwpn\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\Virtualenvs\luffy\include\site\python3.6\mysqlclient' Check the logs for full command output.

解决

方法一

别下最新版本:pip install mysqlclient==2.0.0

image-20220419125928870
image-20220419125928870

方法二

报错信息里给了下载连接, error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

前往此连接下载

实在是太大了,好几个G,我就没下了

image-20220419130328227
image-20220419130328227

祝好运,希望能帮到你!

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2022-04-19,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 【已解决】error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    • pip install mysqlclient报错
      • 解决
      领券
      问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档