Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #74314

Solution-resistant AttributeError: 'modle' object has no attribute...

Date 2014-07-10 09:41 -0700
Subject Solution-resistant AttributeError: 'modle' object has no attribute...
From Dan Stromberg <drsalists@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.11731.1405010485.18130.python-list@python.org> (permalink)

Show all headers | View raw


Hi folks.

I'm having trouble with a strange AttributeError.  I'm using RQ (Redis
Queue) and Django, both of which are new to me, so perhaps they are
somehow relevant.

Anyway, the traceback looks like:
Traceback (most recent call last):
  File "/home/ec2-user/miniconda/envs/sciencedb/lib/python2.7/site-packages/rq/worker.py",
line 479, in perform_job
    rv = job.perform()
  File "/home/ec2-user/miniconda/envs/sciencedb/lib/python2.7/site-packages/rq/job.py",
line 466, in perform
    self._result = self.func(*self.args, **self.kwargs)
  File "/home/ec2-user/science_server/higgins/tasks.py", line 276, in
session_retrieval_manager
    dummy = higgins.models.extract_guid_from_visi_filename
AttributeError: 'module' object has no attribute
'extract_guid_from_visi_filename'

But looking in higgins/models.py, I see a def for
extract_guid_from_visi_filename.

Here's a list of things I've checked/tried, compiled from the first
two pages of google hits on the error, and a couple of my own guesses:
# circular dependency in imports?  No.
# module of same name?  No, because __file__ looks correct
# Not in Django's settings.py's INSTALLED_APPS?  No, higgins is
present in INSTALLED_APPS
# No __init__.py?  There is an __init__.py in the higgins directory
# Old .pyc?  No, I've removed it and same result
# __all__ present?  No
# Need to from module import function?  No, does not help.

BTW, pylint doesn't flag an error.

BTW, I can import and retrieve the function fine in django's "python
manage.py shell".

If I sys.stderr.write the module's __file__, it gives a full path that
looks as expected.

If I sys.stderr.write(dir(higgins.models)), it has some of the symbols
from higgins.models, but some of them are missing, including the
function I want.  It's as though an old version of the module is being
seen, rather than the current version.

Anyone have any (further) suggestions for me?

Thanks!

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Solution-resistant AttributeError: 'modle' object has no attribute... Dan Stromberg <drsalists@gmail.com> - 2014-07-10 09:41 -0700

csiph-web