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;

完成

相关推荐
ZhengEnCi4 小时前
CMD 与 Python 完全区别指南-小白必看的编程入门解惑宝典
windows·python
华阙之梦6 小时前
【在 Windows 上运行 Apache Hadoop 或 Spark/GeoTrellis 涉及 HDFS 】
hadoop·windows·apache
电手6 小时前
微软宣布删除“另存为”选项,今后文件将默认保存到云盘
windows·microsoft·电脑·onedrive·windows11·windows10
AirDroid_cn9 小时前
Win11 远程桌面:连接公司电脑时,提示 “证书错误” 如何解决?
windows·网络协议·https·ssl·电脑技巧
blackorbird10 小时前
使用 Overpass Turbo 查找监控摄像头
运维·服务器·数据库·windows
zhuyasen21 小时前
踩坑实录:Go 1.25.x 编译的 exe 在 Windows 提示“此应用无法运行”
windows·golang
千歌叹尽执夏1 天前
ubuntu24.04lts和Windows11家庭版远程桌面连接若干问题(解决)
windows·远程连接·xrdp·ubuntu24.04lts
sukalot1 天前
Windows显示驱动开发-支持显示输出和 ACPI 事件
windows
爱隐身的官人1 天前
Windows安全狗安装教程
windows·安全·安全设备
wulitoud1 天前
[好用工具] 一款mac/windows电脑历史剪切板工具,类似著名的Paste
windows·macos·sublime text