如何安装 PIL?
>pip install PIL
Downloading/unpacking PIL
Could not find any downloads that satisfy the requirement PIL
Some externally hosted files were ignored (use --allow-external PIL to allow).
Cleaning up...
No distributions at all found for PIL
Storing debug log for failure in /root/.pip/pip.log
>pip uninstall PIL
Can't uninstall 'PIL'. No files were found to uninstall.
最佳答案
pip install PIL --allow-external PIL --allow-unverified PIL
这是由于新版本 Pip 的更改所致。运行pip --version
,我敢打赌您正在运行1.5。请参阅变更日志 here 。这种新的默认行为增强了安全性。在 PIL 的情况下,您要安装的文件实际上来自 effbot.org (因此 --allow-external
),并且 PyPi 没有校验和来保证有效性(因此--允许未验证
)。
此外,您可以考虑使用 Pillow替换为 PIL。
关于python-imaging-library - pip install PIL 未安装到 virtualenv 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21242107/