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;

完成

相关推荐
北十南6 小时前
SODA自然美颜相机(甜盐相机国际版) v9.3.0
android·windows·数码相机
nbsaas-boot6 小时前
用 FreeMarker 动态构造 SQL 实现数据透视分析
数据库·windows·sql·freemarker·数据报表
weixin_446260857 小时前
windows下hashcat使用gpu破解execl打开密码
windows
Evaporator Core18 小时前
Windows批处理脚本自动合并当前目录下由You-get下载的未合并的音视频文件
windows·音视频
十五年专注C++开发1 天前
CMake进阶: externalproject_add用于在构建阶段下载、配置、构建和安装外部项目
linux·c++·windows·cmake·自动化构建
guidovans1 天前
基于tkinter开发电脑工具集(源码在底部)
linux·windows·python·gui·tkinter
ayaya_mana2 天前
Notepad--:国产跨平台文本编辑器,Notepad++ 的理想替代方案
linux·windows·macos·编辑器·notepad·notepad--
昏睡红猹2 天前
如何正确使用SetThreadExecutionState来阻止Windows进入睡眠
windows
霖002 天前
FPGA的PS基础1
数据结构·人工智能·windows·git·算法·fpga开发
江湖夜雨abc2 天前
Windows下cuda的安装和配置
windows