我正在尝试在 Debian 7 服务器上安装支持 JPEG 文件的 Pillow(Python Imaging Library 的一个分支,又名 PIL)。我最初使用以下命令将 Pillow v2.3.0 安装到我的虚拟环境中:
pip install Pillow
但是我从输出中看到 Pillow 默认不支持 JPEG。去年年底,我在我的 Mac 笔记本电脑上安装了 Pillow,但我必须执行以下操作:
pip uninstall Pillow
pip install --no-install Pillow
然后我不得不将此行添加到 build/Pillow/setup.py 文件中:
JPEG_ROOT = 'path/to/my/libjpeg/library'
然后我重新运行“pip install Pillow”,Pillow 构建了 JPEG 支持。
但是现在当我在 Debian 上执行“pip install Pillow”时,我得到了这个错误:
DEPRECATION: --no-install, --no-download, ... are deprecated. See
https://github.com/pypa/pip/issues/906.
一旦我更改了 JPEG_ROOT 并再次运行“pip install Pillow”,我就会收到以下错误:
pip can't proceed with requirement 'Pillow' due to a pre-existing build directory. location: /home/myapp/venv/myapp/build/Pillow
This is likely due to a previous installation that failed.
etc., etc.
当我查看该链接时,我看到“--no-download”选项确实已被弃用。该页面提到了新的“解包”和“下载”选项。
还有其他方法可以重新启动此 pip 安装吗?
谢谢。
更新:
我运行了“pip --help”,但没有看到问题页面中描述的“下载”或“解包”选项。我还尝试使用每个选项运行 pip,以防帮助文件尚未更新但无济于事。我还去了构建目录并运行了“python setup.py”,但这没有用,我什至不确定它是否应该这样做。我还想也许我可以执行通常的“config/make/sudo make install”过程,但没有要运行的配置脚本。
阅读此问题后,我还尝试了以下操作:
mkdir /home/me/pillow
pip install --download="/home/me/pillow" Pillow
cd pillow
(I unzipped the Pillow file and changed to the Pillow directory)
(Then I edited the setup.py file)
pip install --no-index --find-links="/home/me/pillow" Pillow
然后安装了 Pillow,但它仍然不包括 JPEG 支持。我在这里错过了一步吗?它表现得好像它没有看到我更改了 JPEG_ROOT。
请帮忙!谢谢。