[p2pu-dev] Error with PIL Image module

David Beckley beckl.d.413 at isg.edu.sa
Fri Feb 24 18:32:02 UTC 2012


Well, something exploded ;-)

When I tried to create a study group, the whole thing imploded in front of
me, and I got a HTTP 500.

I deleted my virtual environment, and created a new one, this time with the
flag `--no-site-packages`. I had to install these packages with pip:

   - lxml
   - pil
   - m2crypto
   - iso8600

And then I continued with the instructions.

And it worked! Ubuntu's packages can really mess things up sometimes...

Do you think you should change the wiki to include this procedure?

David Beckley
On Fri, Feb 24, 2012 at 7:19 PM, David Beckley <beckl.d.413 at isg.edu.sa>wrote:

> Hi,
>
> I was following Lernanta's Setup/Install<https://github.com/p2pu/lernanta/wiki/Lernanta%27s-Setup-Install>on the GitHub wiki.
>
> I installed PIL with `sudo apt-get install python-imaging`. Then, the
> instructions told me to use `mkvirtualenv lernanta`.
>
> I've done some Python scripting in the past with Blender, but, I've never
> used Django before.
>
> Should I continue using my modified version of Lernanta for development?
> Or will something explode?
>
> Thanks!
> David Beckley
>
>
> On Thu, Feb 23, 2012 at 8:35 PM, Jos Flores <josmasflores at gmail.com>wrote:
>
>> Thanks Zuzel, I have added swig to the dependencies.
>>
>> José
>>
>> On 23 February 2012 17:27, zuzel.vp <zuzel.vp at gmail.com> wrote:
>> > On Thu, Feb 23, 2012 at 6:11 AM, Jos Flores <josmasflores at gmail.com>
>> wrote:
>> >> Hi David,
>> >>
>> >> we all seem to be running into the same problem, so I'm a bit confused
>> >> here. There are two pages in the wiki with instructions for Ubuntu
>> >> which are slightly different.
>> >
>> > Added a warning in the oldest one. The one actively maintained is
>> > https://github.com/p2pu/lernanta/wiki/Lernanta%27s-Setup-Install
>> >
>> >>
>> >> Did you install python-imaging as a pre-requisite? and also, how did
>> >> you create your lernanta virtualenv, using --no-site-packages? or just
>> >> simply: mkvirtualenv lernanta ?
>> >>
>> >> My understanding is that as we are installing imaging as a system
>> >> package we cannot use --no-site-packages, but the ideal would be to
>> >> create a virtualenv isolated from your system packages (in which case
>> >> would you have to install PIL through pip???)
>> >>
>> >> cheers,
>> >> José
>> >>
>> >> On 22 February 2012 19:03, David Beckley <beckl.d.413 at isg.edu.sa>
>> wrote:
>> >>> Hi,
>> >>>
>> >>> When I installed Lernanta (following the instructions in the GitHub
>> wiki)
>> >>> and ran `make syncdb`, I got this error message:
>> >>>
>> >>>     Unhandled exception in thread started by <bound method
>> Command.inner_run
>> >>> of <django.core.management.commands.runserver.Command object at
>> 0x8ad5fcc>>
>> >>>     Traceback (most recent call last):
>> >>>       File
>> >>>
>> "/home/david/.virtualenvs/lernanta/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py",
>> >>> line 88, in inner_run
>> >>>         self.validate(display_num_errors=True)
>> >>>       File
>> >>>
>> "/home/david/.virtualenvs/lernanta/local/lib/python2.7/site-packages/django/core/management/base.py",
>> >>> line 249, in validate
>> >>>         num_errors = get_validation_errors(s, app)
>> >>>       File
>> >>>
>> "/home/david/.virtualenvs/lernanta/local/lib/python2.7/site-packages/django/core/management/validation.py",
>> >>> line 35, in get_validation_errors
>> >>>         for (app_name, error) in get_app_errors().items():
>> >>>       File
>> >>>
>> "/home/david/.virtualenvs/lernanta/local/lib/python2.7/site-packages/django/db/models/loading.py",
>> >>> line 146, in get_app_errors
>> >>>         self._populate()
>> >>>       File
>> >>>
>> "/home/david/.virtualenvs/lernanta/local/lib/python2.7/site-packages/django/db/models/loading.py",
>> >>> line 64, in _populate
>> >>>         self.load_app(app_name)
>> >>>       File
>> >>>
>> "/home/david/.virtualenvs/lernanta/local/lib/python2.7/site-packages/django/db/models/loading.py",
>> >>> line 78, in load_app
>> >>>         models = import_module('.models', app_name)
>> >>>       File
>> >>>
>> "/home/david/.virtualenvs/lernanta/local/lib/python2.7/site-packages/django/utils/importlib.py",
>> >>> line 35, in import_module
>> >>>         __import__(name)
>> >>>       File
>> >>>
>> "/home/david/gitRepos/lernanta/lernanta/../lernanta/apps/users/models.py",
>> >>> line 22, in <module>
>> >>>         from drumbeat import storage
>> >>>       File
>> >>> "/home/david/gitRepos/lernanta/lernanta/apps/drumbeat/storage.py",
>> line 2,
>> >>> in <module>
>> >>>         import Image
>> >>>     ImportError: No module named Image
>> >>>
>> >>> I updated PIL with the command pip install PIL --upgrade, but the
>> same error
>> >>> occurred.
>> >>>
>> >>> Since the line `import Image` was causing the error, I found a list
>> of all
>> >>> the files containing this with grep:
>> >>>
>> >>> lernanta/apps/drumbeat/storage.py
>> >>> lernanta/apps/projects/tasks.py
>> >>> lernanta/apps/projects/utils.py
>> >>>
>> >>> Then, I changed `import Image` to `from PIL import Image` in each of
>> these
>> >>> files. `make syncdb` ran perfectly, as well as `python manage.py
>> runserver`.
>> >>>
>> >>> I am wondering why these changes were necessary. In case it has to do
>> with
>> >>> my environment, I am running Python 2.7.1+ on Ubuntu 11.04, following
>> the
>> >>> instructions on the GitHub wiki.
>> >>>
>> >>> Everything seems to be working fine... I'm just nervous that it might
>> blow
>> >>> up sooner or later.
>> >>>
>> >>>
>> >>>
>> >>>
>> >>> _______________________________________________
>> >>> p2pu-dev mailing list
>> >>> p2pu-dev at lists.p2pu.org
>> >>> http://lists.p2pu.org/mailman/listinfo/p2pu-dev
>> >>>
>> >> _______________________________________________
>> >> p2pu-dev mailing list
>> >> p2pu-dev at lists.p2pu.org
>> >> http://lists.p2pu.org/mailman/listinfo/p2pu-dev
>> > _______________________________________________
>> > p2pu-dev mailing list
>> > p2pu-dev at lists.p2pu.org
>> > http://lists.p2pu.org/mailman/listinfo/p2pu-dev
>> _______________________________________________
>> p2pu-dev mailing list
>> p2pu-dev at lists.p2pu.org
>> http://lists.p2pu.org/mailman/listinfo/p2pu-dev
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p2pu.org/pipermail/p2pu-dev/attachments/20120224/77e408ea/attachment-0001.html>


More information about the p2pu-dev mailing list