问题描述
我正在尝试安装pip包PIL。但是安装不起作用,导致以下错误。 找不到满足要求pil的版本(从xhtml2pdf = = 0.0.4- -r virtualenv-reqs.txt(第16行))(从版本:)
某些外部托管的文件被忽略,因为对它们的访问可能不可靠(使用--allow-external pil允许)。
找不到匹配的发布pil(从xhtml2pdf == 0.0.4-> -r virtualenv-reqs.txt(第16行))
当我有一个较旧版本的pip,但是当前版本的pip 7.1.2
我是无法下载包。我正在使用以下命令安装pip包
pip install --timeout = 1000 -i http:// pypi。 ksjc.sh.colo / simple --trusted-host pypi.ksjc.sh.colo -r virtualenv-reqs.txt
这是什么问题。我认为这可能是一个SSL问题,这就是为什么我添加了 - 信任主机
标志。有没有办法使用 - allow-external
标志与 virtualenv-reqs
文件一起使用。 p>
枕头是PIL的维护叉,所以我建议使用枕头。但是你不能同时安装两个。
-
首先,删除PIL和Pillow。
-
然后安装Pillow with
pip install pillow
(虽然根据平台的不同, a href =https://pillow.readthedocs.org/installation.html =noreferrer>先决条件)。 -
然后确保代码使用PIL导入图像而不是
导入
图片
。
I am trying to install the pip package PIL. However the install doesn't work throwing the following error.
Could not find a version that satisfies the requirement pil (from xhtml2pdf==0.0.4->-r virtualenv-reqs.txt (line 16)) (from versions: )
Some externally hosted files were ignored as access to them may be unreliable (use --allow-external pil to allow).
No matching distribution found for pil (from xhtml2pdf==0.0.4->-r virtualenv-reqs.txt (line 16))
The install does work when I have an older version of pip, but with the current version of pip 7.1.2
I am not able to download the package. I am using the following command to install the pip packages
pip install --timeout=1000 -i http://pypi.ksjc.sh.colo/simple --trusted-host pypi.ksjc.sh.colo -r virtualenv-reqs.txt
What is the issue with this. I thought it might be an SSL issue which is why I added the --trusted-host
flag. Is there any way to the --allow-external
flag to be used with the virtualenv-reqs
file.
Pillow is a maintained fork of PIL, so I recommend using Pillow. But you can't have both installed at the same time.
First, remove both PIL and Pillow.
Then install Pillow with
pip install pillow
(although, depending on platform, you may need some prerequisites).Then make sure code is using
from PIL import Image
rather thanimport Image
.
这篇关于pip安装PIL失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!