Snow Leopard,Django&的问题皮尔 [英] Problems with Snow Leopard, Django & PIL

查看:93
本文介绍了Snow Leopard,Django&的问题皮尔的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在获取Django&时遇到了一些麻烦自升级到Snow Leopard以来,PIL正常工作.

I am having some trouble getting Django & PIL work properly since upgrading to Snow Leopard.

我已经安装了freetype,libjpeg和PIL,这告诉我:

I have installed freetype, libjpeg and then PIL, which tells me:

--- TKINTER support ok
--- JPEG support ok
--- ZLIB (PNG/ZIP) support ok
--- FREETYPE2 support ok

但是当我尝试通过django管理界面上传jpeg时,我得到了:

but when I try to upload a jpeg through the django admin interface I get:

上传有效图像.文件你 上传的不是图片还是 图片已损坏.

Upload a valid image. The file you uploaded was either not an image or a corrupted image.

它可以与PNG文件配合使用.

It works fine with PNG files.

有什么想法吗?

推荐答案

卡托

我对Leopard 10.5.x也有同样的经验 这是我为修复它所做的事情(可能对您不起作用).

I had the same experience with Leopard 10.5.x Here is what I did to fix it, (may not work for you).

  1. 转到您的PIL工作文件夹(在其中解压缩PIL) cd到您的构建文件夹 cd到您的lib.macosx-10.*文件夹(特定于您的操作系统) 删除* .so cd返回您的PIL构建文件夹 (我为此以su身份登录,但您可以根据需要对它们进行sudo的操作)
  2. python setup.py clean
  3. python setup.py构建
  4. python setup.py安装
  1. Go to your PIL working folder (where you unzipped PIL) cd to your build folder cd to your lib.macosx-10.* folder (specific to your os) remove *.so cd back to your PIL build folder (I logged in as su for this, but you can sudo these if you like)
  2. python setup.py clean
  3. python setup.py build
  4. python setup.py install

这将重建PIL干净.您的jpeg报告正常的原因是,它只是查找jpeg lib文件的存在,而不是由于干净构建和安装PIL而产生的依赖关系.

This rebuilds PIL clean. The reason your jpeg reports ok, is that it just looks for the existence of the jpeg lib files, but not the dependency that happens from a clean build and install of PIL.

希望这可以解决您的问题,我的问题很可能与安装顺序有关,但也许会有所帮助...

Hope this solves your problem, mine was more likely related to the order of installation but maybe it will help...

这篇关于Snow Leopard,Django&的问题皮尔的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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