TypeError: 'module' object is not callable

748 views
Skip to first unread message

Alejandro Jesus Nuñez Madrazo

unread,
Apr 2, 2013, 10:06:47 AM4/2/13
to class2g...@googlegroups.com
Hi all, I'm trying to mount in debian class2go on OpenVZ container, but when syncdb. I get this error:

root@vserver17:/srv/www/class2go/main# python manage.py syncdb
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 196, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 231, in execute
    self.validate()
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 266, in validate
    num_errors = get_validation_errors(s, app)
  File "/usr/lib/python2.7/dist-packages/django/core/management/validation.py", line 30, in get_validation_errors
    for (app_name, error) in get_app_errors().items():
  File "/usr/lib/python2.7/dist-packages/django/db/models/loading.py", line 158, in get_app_errors
    self._populate()
  File "/usr/lib/python2.7/dist-packages/django/db/models/loading.py", line 64, in _populate
    self.load_app(app_name, True)
  File "/usr/lib/python2.7/dist-packages/django/db/models/loading.py", line 88, in load_app
    models = import_module('.models', app_name)
  File "/usr/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/srv/www/class2go/main/c2g/models.py", line 31, in <module>
    from kelvinator.tasks import sizes as video_resize_options
  File "/srv/www/class2go/main/kelvinator/tasks.py", line 217, in <module>
    @task()
TypeError: 'module' object is not callable

Thank you very much

Joe Blaylock

unread,
Apr 2, 2013, 1:36:36 PM4/2/13
to Alejandro Jesus Nuñez Madrazo, class2g...@googlegroups.com
Hi Alejandro,

That's quite strange; it seems to work fine from this end. Are you sure that you have all of the dependencies installed in your environment? Particularly, have you got django-celery?

Joe

--
You received this message because you are subscribed to the Google Groups "class2go users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to class2go-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Alejandro Jesus Nuñez Madrazo

unread,
Apr 2, 2013, 2:06:04 PM4/2/13
to class2g...@googlegroups.com, Alejandro Jesus Nuñez Madrazo, jr...@stanford.edu
Hi joe
i have installed python-django-celery from repo of debian.

Joe Blaylock

unread,
Apr 2, 2013, 2:29:53 PM4/2/13
to Alejandro Jesus Nuñez Madrazo, class2g...@googlegroups.com
Are you using virtualenv? I've noticed on my Ubuntu machine that if I'm using virtualenv, the system packages don't end up on my python path. There's probably an easy fix, but I've just gotten into the habit of installing the python dependencies only with pip.

Joe

Alejandro Jesus Nuñez Madrazo

unread,
Apr 2, 2013, 2:53:51 PM4/2/13
to class2g...@googlegroups.com, Alejandro Jesus Nuñez Madrazo, jr...@stanford.edu
No, i'm not using virtualenv, not use pip, because my server is behind a firewall I did was download the packages and install them manually. Others install the debian repo. That's why it does not work?

thx for all

Joe Blaylock

unread,
Apr 2, 2013, 3:08:17 PM4/2/13
to Alejandro Jesus Nuñez Madrazo, class2g...@googlegroups.com
Well, that was the first thing I could think of. You could confirm that the celery parts are found on your python path by running python interactively and manually trying 
from celery import task

But come to think of it, if that were the problem you would already have seen something blow up.

Hm, what version of the celery library do you have installed? When I look at my lib/python/site-packages over here I've got django_celery-3.0.11-py2.7 and celery-3.0.11-py2.7. On my Ubuntu system, the version of celery I can install with apt-get is quite a bit older - 2.4.2 - and if that's what you have, that may be the source of the difference.

If so, you could try simply removing the parentheses from next to the @task decorator so that it says 
@task
instead of saying
@task()
and see if that makes it start to work.  That may not be an ideal solution, though, since we don't know what else may be different from one version of celery to the next.

If your version of celery is much older than 3.0, my guess is that that's the problem an that you'll need to update with a more recent one, either from pip or from a custom Debian repository.

(By the way, pip can fetch packages over HTTP, which usually passes through firewalls OK. You should be able to apt-get install python-pip to get it from the debian repository, and then use pip search and pip install to get other Python packages.)

I hope something there helps,
Joe

Alejandro Jesus Nuñez Madrazo

unread,
Apr 3, 2013, 12:31:02 PM4/3/13
to class2g...@googlegroups.com, Alejandro Jesus Nuñez Madrazo, jr...@stanford.edu
Thx for all joe, i upgrade celery to last version and work fine :)

Alejandro

Joe Blaylock

unread,
Apr 3, 2013, 12:49:28 PM4/3/13
to Alejandro Jesus Nuñez Madrazo, class2g...@googlegroups.com
Awesome, glad to hear it. :)
Reply all
Reply to author
Forward
0 new messages