如何使用pip在Windows上安装Pillow? [英] How to install Pillow on Windows using pip?

查看:260
本文介绍了如何使用pip在Windows上安装Pillow?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Windows上安装Pillow 3.1. 按照说明,我应该能够输入:

I'm trying to install Pillow 3.1 on Windows. Per the instructions, I should be able to just type in:

pip install Pillow

但是我得到:

ValueError: jpeg is required unless explicitly disabled using --disable-jpeg, aborting

因为现在(我认为从3.0之后的版本开始?),必须安装libjpeg才能安装枕头.我不知道如何在Windows上做到这一点.也许安装Ming之类的东西.但是我真的希望有一个简单的pip安装.

Because now (starting with versions after 3.0 I think?) libjpeg is required for pillow to be installed. I don't know how to do that magic on Windows. Maybe install Ming or something. But I was really hoping for a simple pip install.

我可以通过直观的命令禁用这些选项:

I can disable these options through the intuitive command:

pip install --upgrade pillow --global-option="build_ext" --global-option="--disable-jpeg" --global-option="--disable-zlib"

但是随后构建失败,因为我没有安装Visual C ++.

But then the build fails because I don't have Visual C++ installed.

是的,我可以通过从非官方存储库列表中下载它来安装Pillow.但是有没有办法在Windows上使用pip做到这一点,而无需进行大量额外安装?

Yes, I can install Pillow by downloading it from the unofficial repository list. But is there a way to do it with pip on Windows without a lot of extra installs?

推荐答案

到目前为止,在Windows上最简单的操作是使用预构建的二进制文件安装Pillow,而不是尝试自己构建它.

By far the easiest thing to do on Windows is install Pillow using pre-built binaries rather than trying to build it yourself.

当有新的Pillow版本发布时,通常需要一天左右的时间来构建和上传Windows二进制文件.

When there's a new Pillow release, it usually takes a day or so for the Windows binaries to be built and uploaded.

您在此窗口期间遇到了此问题. Windows二进制文件现在已启动,因此您可以使用pip install pillow(或).

You ran into this problem during this window. The Windows binaries are now up so you can install with pip install pillow (or pip install -U pillow).

如果在此窗口期间需要Pillow,则可以使用pip install pillow==3.0.0之类的二进制文件安装给定的先前版本.

If you need Pillow during this window, you can install a given previous version with binaries like pip install pillow==3.0.0.

这篇关于如何使用pip在Windows上安装Pillow?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆