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;

完成

相关推荐
gentle coder9 小时前
testOne
windows
~黄夫人~10 小时前
零基础速通|Windows&Linux 常用命令行对照表大全
linux·运维·windows·笔记·备忘录·整理表格
一个人旅程~13 小时前
linux如何“抢”过windows的usb移动硬盘权限对0磁道损坏的移动硬盘进行尝试修复
linux·windows·经验分享·电脑
Keano Reurink14 小时前
长尾关键词自动化扩展:从1个种子词到1000个长尾词
运维·windows·自动化
新时代农民工~15 小时前
PostgreSQL 主从复制(流复制)实战配置指南:Windows 环境详细步骤
数据库·windows·postgresql
AI周红伟15 小时前
通用业务智能体OpenClaw+Skills+RAG+Agent构建案例实操
大数据·人工智能·windows·百度·copilot
a588081115 小时前
WarCraft III《魔兽争霸3冰封王座》原版安装包——游戏玩法、配置要求与详细安装教程
windows·游戏·游戏程序
Chirp17 小时前
Windows下借助wsl2读取ext4格式磁盘
linux·windows
CAE虚拟与现实20 小时前
img格式的文件在windows上怎么打开
windows·img文件·微软img
a588081120 小时前
星际争霸1原版安装包——游戏玩法、配置要求与详细安装教程
windows·游戏·游戏程序