Pillow不支持JPEG支持 - 安装Django Cms

时间:2014-04-29 20:21:50

标签: macos django-cms libjpeg pillow

我试图让Django Cms在我的系统上工作。 遵循Django-CMS教程:https://github.com/divio/django-cms-tutorial

我必须安装枕头,但现在我跑的时候:

$ djangocms -p . my_demo

并填写所有选项,我收到以下错误:

HTTP error 404 while getting https://github.com/divio/django-cms/archive/3.0c2.zip
Exception:
Traceback (most recent call last):
  File "/Users/macbook/Desktop/MyProjects/djangoCMS/demo/demoEnv/lib/python2.7/site-    packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
  File "/Users/macbook/Desktop/MyProjects/djangoCMS/demo/demoEnv/lib/python2.7/site-    packages/pip/commands/install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/Users/macbook/Desktop/MyProjects/djangoCMS/demo/demoEnv/lib/python2.7/site-packages/pip/req.py", line 1197, in prepare_files
do_download,
  File "/Users/macbook/Desktop/MyProjects/djangoCMS/demo/demoEnv/lib/python2.7/site-packages/pip/req.py", line 1375, in unpack_url
self.session,
  File "/Users/macbook/Desktop/MyProjects/djangoCMS/demo/demoEnv/lib/python2.7/site-packages/pip/download.py", line 547, in unpack_http_url
resp.raise_for_status()
  File "/Users/macbook/Desktop/MyProjects/djangoCMS/demo/demoEnv/lib/python2.7/site-packages/pip/_vendor/requests/models.py", line 773, in raise_for_status
raise HTTPError(http_error_msg, response=self)
HTTPError: 404 Client Error: Not Found

Storing debug log for failure in /Users/macbook/.pip/pip.log
Traceback (most recent call last):
  File "/Users/macbook/Desktop/MyProjects/djangoCMS/demo/demoEnv/bin/djangocms", line 11, in <module>
sys.exit(execute())
  File "/Users/macbook/Desktop/MyProjects/djangoCMS/demo/demoEnv/lib/python2.7/site-packages/djangocms_installer/main.py", line 24, in execute
install.check_install(config_data)
  File "/Users/macbook/Desktop/MyProjects/djangoCMS/demo/demoEnv/lib/python2.7/site-packages/djangocms_installer/install/__init__.py", line 54, in check_install
raise EnvironmentError("\n".join(errors))
EnvironmentError: Pillow is not compiled with JPEG support, see 'Libraries installation issues' documentation section.

在搜索网页时,我发现我必须安装libjpeg

即使这样做我也得到了同样的错误。现在我不能让它工作,我真的想与Django CMS合作。我确信在安装libjpeg时我做错了什么。但我现在很确定如何开始吧!

2 个答案:

答案 0 :(得分:5)

有类似的问题。以下是我如何摆脱它。

  1. 安装枕头,具有所有必要的依赖关系。 你可以参考这个link 如果您在mac上运行,只需键入以下命令即可 $ brew安装libtiff libjpeg webp little-cms2 $ pip install Pillow

  2. 如果您观察得很好,您会注意到程序试图访问github.com/divio/django-cms/archive/3.0c2.zip时出错 您需要删除&#34; c2&#34;留在github.com/divio/django-cms/archive/3.0.zip

  3. 要编辑它,请转至/env/lib/python2.7/site-packages/djangocms_installer/config env是您正在使用的环境(如果您使用的是virtualenv。只需找到您的site-packages目录)

    打开data.py并按上述方法更改第7行。您可能需要更改文件的权限才能对其进行编辑。

    从现在开始,它应该运作良好。

    希望它有所帮助。

答案 1 :(得分:0)

我的情况:

使用以下命令进行诊断:

python -c 'from PIL import Image'

原因:库版本不兼容:libtiff.5.dylib需要版本13.0.0或更高版本,但libjpeg.8.dylib提供版本12.0.0

溶液:

pip uninstall PIL
pip uninstall Pillow

brew uninstall libpng
brew uninstall libjpeg
brew uninstall webp
brew uninstall libtiff
brew uninstall littlecms
brew prune => to clean symlink

brew install  libjpeg webp libtiff littlecms libpng

pip install Pillow

如果libpng错误为:下载失败:https://downloads.sf.net/project/libpng/libpng16/1.6.13/libpng-1.6.13.tar.xz

cd /Library/Caches/Homebrew
download the package from browser and copy here
brew install libpng