You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows10下安装Python的mysqlclient失败,提示需Microsoft Visual C++10.0

Fixing "Microsoft Visual C++ 10.0 is required" when installing mysqlclient for Python 3.4

Hey, I’ve dealt with this exact error a few times when setting up mysqlclient on Windows with older Python versions like 3.4. Here’s how to get past it:

Option 1: Install the required compiler environment

The error pops up because Python 3.4 was compiled with Microsoft Visual C++ 10.0, and the mysqlclient extension needs the same compiler to build correctly. Here’s the step-by-step:

  • Download and install the Microsoft Windows SDK 7.1 (which includes VC++ 10.0).
  • Heads up: If you already have newer Visual Studio versions or VC++ Redistributables installed, you might hit conflicts during the SDK installation. Temporarily uninstall any VC++ 2010 Redistributable packages first, install the SDK, then reinstall the redistributables afterward to fix this.

Option 2: Use a pre-compiled wheel (easier workaround)

Compiling extensions from source can be a headache, so using a pre-built wheel is often the faster path:

  • Locate a trusted source of pre-compiled wheels for mysqlclient, making sure to pick the one that matches your Python 3.4 installation and system architecture (32-bit or 64-bit).
  • Once you’ve downloaded the correct .whl file, install it directly with pip:
    pip install path/to/your/mysqlclient-file-name.whl
    

Verify the installation

After either method, open your Python shell and run:

import MySQLdb

If you don’t get any error messages, the installation worked!

内容的提问来源于stack exchange,提问作者Jayed Khan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 03:43:16