
Hi all! I have a virtualenv created with --no-site-packages option and I'm going to install there Django and some required libs using buildout. The problematic library is PIL. Here is my buildout.cfg [buildout] parts = PIL django [django] recipe = djangorecipe version = 1.1 project = project eggs = psycopg2 PIL south django-reversion django-cms wsgi = true settings = production [PIL] recipe = zc.recipe.egg:custom egg = PIL==1.1.6 find-links = http://dist.repoze.org and it is something generally recommended by other users. See: http://www.stereoplex.com/two-voices/a-django-development-environment-with-z... I also tried some other versions of [PIL] like: [PIL] recipe = zc.recipe.egg:custom egg = PIL==1.1.6 find-links = http://dist.repoze.org/PIL-1.1.6.tar.gz index = http://dist.repoze.org/index The first problem is that the above recipe installs PIL 1.1.7 instead of 1.1.6. Here is install log: python bin/buildout -c devel.cfg Updating django. Getting distribution for 'PIL'. WARNING: '' not a valid package name; please use only.-separated package names in setup.py In file included from /usr/include/python2.6/Python.h:8, from libImaging/ImPlatform.h:10, from libImaging/Imaging.h:14, from Tk/tkImaging.c:53: /usr/include/python2.6/pyconfig.h:1028:1: warning: "_POSIX_C_SOURCE" redefined In file included from /usr/include/stdio.h:28, from /usr/include/tcl.h:141, from /usr/include/tk.h:21, from Tk/tkImaging.c:51: /usr/include/features.h:210:1: warning: this is the location of the previous definition -------------------------------------------------------------------- PIL 1.1.7 SETUP SUMMARY -------------------------------------------------------------------- version 1.1.7 platform linux2 2.6.4 (r264:75706, Oct 27 2009, 06:16:59) [GCC 4.4.1] -------------------------------------------------------------------- --- TKINTER support available --- JPEG support available --- ZLIB (PNG/ZIP) support available --- FREETYPE2 support available --- LITTLECMS support available -------------------------------------------------------------------- To check the build, run the selftest.py script. zip_safe flag not set; analyzing archive contents... Image: module references __file__ Got PIL 1.1.7. Second problem is that the above PIL installation doesn't work with Django: bin/django validate Error: One or more models did not validate: picture.picture: "image": To use ImageFields, you need to install the Python Imaging Library. Get it at http://www.pythonware.com/products/pil/ . At the same time, everything is ok when I manually install PIL using: pip install http://effbot.org/downloads/Imaging-1.1.6.tar.gz Any hints? Jakub

Hi, On Mon, Nov 23, 2009 at 12:26, Restless Being <restless.being@gmail.com> wrote:
Hi all!
I have a virtualenv created with --no-site-packages option and I'm going to install there Django and some required libs using buildout. The problematic library is PIL. Here is my buildout.cfg
PIL is known to have issues with buildout. Your problem is that it puts it's files in <buildout>/eggs/PIL-#.#.#-py#.#-##.egg/, whereas it should put them in <buildout>/eggs/PIL-#.#.#-py#.#-##.egg/PIL/. As a workaround, you could run buildout like this (or put this in a shell script): ./bin/buildout -N && mkdir `find eggs -iname PIL*.egg`/PIL && mv `find eggs -iname PIL*.egg`/*.* `find eggs -iname PIL*.egg`/PIL I know it looks rather ugly. I don't know if there's a better solution though.
[buildout] parts = PIL django
[django] recipe = djangorecipe version = 1.1 project = project eggs = psycopg2 PIL south django-reversion django-cms wsgi = true settings = production
[PIL] recipe = zc.recipe.egg:custom egg = PIL==1.1.6 find-links = http://dist.repoze.org
With my ugly from above, you can simply define PIL as a dependency in setup.py or or buildout.cfg, no need for a special recipe.
and it is something generally recommended by other users. See: http://www.stereoplex.com/two-voices/a-django-development-environment-with-z...
I also tried some other versions of [PIL] like: [PIL] recipe = zc.recipe.egg:custom egg = PIL==1.1.6 find-links = http://dist.repoze.org/PIL-1.1.6.tar.gz index = http://dist.repoze.org/index
The first problem is that the above recipe installs PIL 1.1.7 instead of 1.1.6. Here is install log:
Why would you need 1.1.6? 1.1.7 should be a bugfix release anyway... - Show quoted text - It's because the files are not in their directory (PIL), so it's not recognized as a package. After the movearound everything should work fine. Bests, Attila

2009/11/23 Attila Oláh <attilaolah@gmail.com>
PIL is known to have issues with buildout. Your problem is that it puts it's files in <buildout>/eggs/PIL-#.#.#-py#.#-##.egg/, whereas it should put them in <buildout>/eggs/PIL-#.#.#-py#.#-##.egg/PIL/.
As a workaround, you could run buildout like this (or put this in a shell script):
./bin/buildout -N && mkdir `find eggs -iname PIL*.egg`/PIL && mv `find eggs -iname PIL*.egg`/*.* `find eggs -iname PIL*.egg`/PIL
I know it looks rather ugly. I don't know if there's a better solution though.
It's ugly but the problem is rather that I'd like to use buildout to avoid such things (it's my first buildout config). But thanks.
Why would you need 1.1.6? 1.1.7 should be a bugfix release anyway...
Because 1.1.6 from repoze has correct structure. It has PIL in its egg. This config installs both PILs 1.1.6 and 1.1.7: [buildout] parts = PIL django omlette cms-media [PIL] recipe = zc.recipe.egg eggs = PIL==1.1.6 find-links = http://dist.repoze.org [django] recipe = djangorecipe version = 1.1 project = project eggs = PIL psycopg2 south django-reversion django-cms wsgi = true settings = production [omlette] recipe = collective.recipe.omelette eggs = ${django:eggs} [cms-media] recipe = svetlyak40wt.recipe.symlinks path = project/media files = ${buildout:parts-directory}/omlette/cms/media/cms cms but this work as expected: [buildout] parts = PIL django omlette cms-media [PIL] recipe = zc.recipe.egg eggs = PIL==1.1.6 find-links = http://dist.repoze.org [django] recipe = djangorecipe version = 1.1 project = project eggs = PIL == 1.1.6 psycopg2 south django-reversion django-cms wsgi = true settings = production [omlette] recipe = collective.recipe.omelette eggs = ${django:eggs} [cms-media] recipe = svetlyak40wt.recipe.symlinks path = project/media files = ${buildout:parts-directory}/omlette/cms/media/cms cms So it's solved. Buildout was installing two different versions of PIL, one for PIL part (1.1.6) and another one for django part (1.1.7). After I added specific version to PIL in django it works :D One more question. Why after I added eggs = psycopg2 just after [buildout] buildout reported that it is omitting unused eggs in [buildout]? I had to move psycopg2 to eggs in djangopart. Jakub

Hi, On Mon, Nov 23, 2009 at 19:36, Restless Being <restless.being@gmail.com> wrote:
2009/11/23 Attila Oláh <attilaolah@gmail.com>
PIL is known to have issues with buildout. Your problem is that it puts it's files in <buildout>/eggs/PIL-#.#.#-py#.#-##.egg/, whereas it should put them in <buildout>/eggs/PIL-#.#.#-py#.#-##.egg/PIL/.
As a workaround, you could run buildout like this (or put this in a shell script):
./bin/buildout -N && mkdir `find eggs -iname PIL*.egg`/PIL && mv `find eggs -iname PIL*.egg`/*.* `find eggs -iname PIL*.egg`/PIL
I know it looks rather ugly. I don't know if there's a better solution though.
It's ugly but the problem is rather that I'd like to use buildout to avoid such things (it's my first buildout config). But thanks.
Why would you need 1.1.6? 1.1.7 should be a bugfix release anyway...
Because 1.1.6 from repoze has correct structure. It has PIL in its egg. This config installs both PILs 1.1.6 and 1.1.7: [buildout] parts = PIL django omlette cms-media
[PIL] recipe = zc.recipe.egg eggs = PIL==1.1.6 find-links = http://dist.repoze.org
[django] recipe = djangorecipe version = 1.1 project = project eggs = PIL psycopg2 south django-reversion django-cms wsgi = true settings = production
[omlette] recipe = collective.recipe.omelette eggs = ${django:eggs}
[cms-media] recipe = svetlyak40wt.recipe.symlinks path = project/media files = ${buildout:parts-directory}/omlette/cms/media/cms cms
but this work as expected: [buildout] parts = PIL django omlette cms-media
[PIL] recipe = zc.recipe.egg eggs = PIL==1.1.6 find-links = http://dist.repoze.org
[django] recipe = djangorecipe version = 1.1 project = project eggs = PIL == 1.1.6 psycopg2 south django-reversion django-cms wsgi = true settings = production
[omlette] recipe = collective.recipe.omelette eggs = ${django:eggs}
[cms-media] recipe = svetlyak40wt.recipe.symlinks path = project/media files = ${buildout:parts-directory}/omlette/cms/media/cms cms
Ah, I missed that. Of course, djangorecipe thought it'd be a good idea to update PIL.
So it's solved. Buildout was installing two different versions of PIL, one for PIL part (1.1.6) and another one for django part (1.1.7). After I added specific version to PIL in django it works :D One more question. Why after I added eggs = psycopg2 just after [buildout] buildout reported that it is omitting unused eggs in [buildout]? I had to move psycopg2 to eggs in djangopart. Jakub
No idea; psycopg2 used to work for my buildout-based projects, but I haven't tried it with djangorecipe before, but I've just tried it now: it is working for me. How does your buildout.cfg look like? Do you depend on psycopg2 in your setup.py (or is it in an extra)? Cheers, Attila

On Mon, Nov 23, 2009 at 1:36 PM, Restless Being ...
So it's solved. Buildout was installing two different versions of PIL, one for PIL part (1.1.6) and another one for django part (1.1.7). After I added specific version to PIL in django it works :D
Great! :)
One more question. Why after I added eggs = psycopg2 just after [buildout] buildout reported that it is omitting unused eggs in [buildout]? I had to move psycopg2 to eggs in djangopart.
It expect it said "Unused option for buildout: eggs". The eggs option doesn't mean anything to the buildout section. This message was just letting you know that something wasn't right. The information you provided was having no effect. Jim -- Jim Fulton

2009/11/23 Jim Fulton <jim@zope.com>
It expect it said "Unused option for buildout: eggs".
Exactly.
The eggs option doesn't mean anything to the buildout section. This message was just letting you know that something wasn't right. The information you provided was having no effect.
I think i didn't understand the following snippet from http://jacobian.org/writing/django-apps-with-buildout/: *** [buildout] parts = python develop = . eggs = django-shorturls [python] recipe = zc.recipe.egg interpreter = python eggs = ${buildout:eggs} *** Now I see that the "eggs = django-shortuls" isn't there for buildout section, it is there for other sections which include it with $(buildout:eggs). Thanks a lot! Jakub
participants (3)
-
Attila Oláh
-
Jim Fulton
-
Restless Being