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;

完成

相关推荐
сокол1 天前
【网安-应急响应-基础记录】Windows入侵排查
windows·web安全·网络安全·系统安全
Bruce_Liuxiaowei1 天前
Windows防火墙规则导出工具:让安全配置可备份、可迁移、可审计
运维·windows·安全·网络安全
x***r1511 天前
Postman-win64-7.3.5-Setup安装步骤详解(附接口测试入门教程)
windows
无名咸鱼1 天前
cursor节省token工具-RTK (windows安装)
windows
dLYG DUMS1 天前
SQLMAP的下载安装和使用(Windows)
windows
十五年专注C++开发1 天前
MobaXterm:Windows 远程工作全能工具箱
linux·windows·mobaxterm
eRRA OFAG1 天前
Windows 上彻底卸载 Node.js
windows·node.js
John_ToDebug1 天前
从 Win10 到 Win11 22H2+:任务栏美化中的“蒙版”和“Hover 色块”渲染原理解析
c++·chrome·windows
java_logo1 天前
Docker 部署 Hermes Agent 完整指南(Windows / Linux 通用)
linux·windows·docker·hermes-agent部署·docker部署hermes·hermes-agent教程·hermes-agent文档
易生一世1 天前
Kiro CLI的Windows安装及认证
windows·ai·kiro