Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'attribute': 0.07; "subject:' ": 0.07; 'dependency': 0.09; "django's": 0.09; 'django,': 0.09; 'expected.': 0.09; 'name?': 0.09; 'seen,': 0.09; 'def': 0.12; '"python': 0.16; '__all__': 0.16; '__file__,': 0.16; '__init__.py': 0.16; 'function?': 0.16; 'hits': 0.16; 'manage.py': 0.16; "module's": 0.16; 'relevant.': 0.16; 'skip:" 80': 0.16; 'subject:object': 0.16; 'symbols': 0.16; 'to:name:python list': 0.16; 'module': 0.19; "skip:' 30": 0.19; 'version.': 0.19; 'help.': 0.21; 'import': 0.22; 'circular': 0.24; 'skip:e 30': 0.24; 'fine': 0.24; 'looks': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; "i've": 0.25; 'compiled': 0.26; 'skip:" 40': 0.26; 'function': 0.29; 'correct': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'gives': 0.31; 'anyone': 0.31; 'file': 0.32; 'me?': 0.32; 'thanks!': 0.32; '(most': 0.33; 'trouble': 0.34; 'skip:s 30': 0.35; 'no,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'google': 0.35; 'there': 0.35; 'version': 0.36; 'error.': 0.37; 'two': 0.37; 'list': 0.37; 'being': 0.38; 'to:addr:python-list': 0.38; 'rather': 0.38; 'recent': 0.39; 'does': 0.39; 'to:addr:python.org': 0.39; 'full': 0.61; 'new': 0.61; 'no.': 0.61; 'skip:* 10': 0.61; 'first': 0.61; 'subject:skip:A 10': 0.78; 'subject:Solution': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=UE6RSPtlbwbrmCsI6n4k5HoAZYXdhhfAmRIPrAb3DtA=; b=baQn5KSp1tfZWdHGqeHUivcaD6tcz7QbRyHq0HUC/AE/g0BRcWBu3tvGuNWc1tauwe YF4kNwgG91iE7HqkA83cxAUiPM4uHgv/F7XHYxdYgsTb/PmO89LYknP2ohBc22mFsimo Odx9KkqY4kgoGVqAQdaaUyXdYD5qRUW1equPWAQg0OvuHxVbmSZtGdRKkiJsdAlOkEuL bcVzgTXSPvMN/LetbFS8FX+wGFoJvWA7pIqN2JGqpCIx9lCmHXXQp5IkZcDe4nbHPnMl B2zL6IF6ZwfuHoX9P7eswb0+LygWdO5vMQCuwdOPS/SAZd/5w//FfOvLImRa2p6yR9hC Xocg== MIME-Version: 1.0 X-Received: by 10.58.179.39 with SMTP id dd7mr725126vec.75.1405010482331; Thu, 10 Jul 2014 09:41:22 -0700 (PDT) Date: Thu, 10 Jul 2014 09:41:22 -0700 Subject: Solution-resistant AttributeError: 'modle' object has no attribute... From: Dan Stromberg To: Python List Content-Type: text/plain; charset=UTF-8 Cc: isaac.henry@soterawireless.com X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 50 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1405010485 news.xs4all.nl 2878 [2001:888:2000:d::a6]:52808 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:74314 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!