Windows 10 系统下解决 “Could not build wheels for pillow“

  1. 安装 Visual C++ Build Tools:

访问 Visual Studio 下载页面,选择下载适用于你的操作系统的版本,并运行安装程序。

复制代码
https://visualstudio.microsoft.com/zh-hans/vs/

在 Visual Studio 安装程序中选择 "使用 C++ 的桌面开发" 工作负载,并确保勾选了相关的组件,

  • "Windows 10 SDK"
  • "MSVC v142 - VS 2019 C++ x64/x86 build tools (v14.29)"

完成安装后,打开 "x64 Native Tools Command Prompt for VS 2019" 或 "x86 Native Tools Command Prompt for VS 2019",该命令提示符会自动设置正确的环境变量。


  1. 安装pillow:

    pip install pillow==8.4.0 -i https://mirrors.aliyun.com/pypi/simple/

如果成功了就不需要第三步了, over


  1. 设置环境变量:

打开命令提示符,并在其中输入以下命令,以设置 INCLUDE 环境变量:

shell 复制代码
set INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\include;C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared;C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um;C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\winrt;

继续在命令提示符中输入以下命令,设置 LIB 环境变量:

shell 复制代码
set LIB=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\lib\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\x86;

完成

相关推荐
90后小陈老师17 小时前
Windows 10 下 Gitee SSH 连接配置详解(附常见问题解决)
windows·gitee·ssh
Light Gao18 小时前
MCPHub 路由原理:一个入口如何管理并调用上百个 MCP Server
windows·microsoft
郭涤生19 小时前
Windows + Ubuntu 双系统启动故障修复
linux·windows·ubuntu
看浪的路人1 天前
第3讲:代码补全引擎
开发语言·windows·python
进击切图仔1 天前
在 windows 和 ubuntu 中配置 host 文件
linux·windows·ubuntu
烟锁池塘柳01 天前
【亲测有效】Windows上更新NVIDIA显卡驱动的方法
windows·nvidia·显卡驱动
看浪的路人1 天前
第5讲:代码审查与 Bug 检测
开发语言·windows·python
molaoye1 天前
Windows修改系统环境变量不需要重启电脑之骚操作
windows
wling03012 天前
vasp虚频计算-python脚本
开发语言·windows·python·vasp计算
在世修行2 天前
Windows 上 Docker Desktop 部署 MySQL + TDengine 全过程(含 WSL 报错与镜像加速排障实战)
windows·mysql·docker·tdengine