10 messages in com.googlegroups.pylons-discussRe: No module named lib.base?
FromSent OnAttachments
Anil24 Nov 2006 11:57 
Adam Ruczko24 Nov 2006 13:26 
John_Nowlan27 Nov 2006 08:48 
Ian Bicking27 Nov 2006 09:18 
John_Nowlan27 Nov 2006 11:11 
Ben Bangert27 Nov 2006 11:42 
Philip Jenvey27 Nov 2006 11:48 
John_Nowlan27 Nov 2006 13:43 
Shannon -jj Behrens27 Nov 2006 14:05 
John_Nowlan28 Nov 2006 07:08 
Subject:Re: No module named lib.base?
From:Shannon -jj Behrens (jjin@public.gmane.org)
Date:11/27/2006 02:05:56 PM
List:com.googlegroups.pylons-discuss

If you change the module name, don't you have to change the controller name to match? I think there is a bit of name magic.

-jj

On 11/27/06, John_Nowlan <john_nowlan-dmoCqaWXHRUsA/PxXw@public.gmane.org>
wrote:

Thanks, should have known not to call my controller module the same as the
webapps.

If I change the name of the controller class, i.e. from TemplateController to
xxx I get: exceptions.AttributeError: 'module' object has no attribute 'TemplateController' but pylons.routes_dict {'action': 'test', 'controller': 'template', 'id': None}
appears to have the right data

Is there something special about the controller class name that I am missing or
is this a small bug?

-----Original Message----- From: pylons-discuss-/JYPx@public.gmane.org [mailto:pylons-discuss-/JYPx@public.gmane.org]On Behalf Of
Philip Jenvey Sent: Monday, November 27, 2006 2:49 PM To: pylons-discuss-/JYPx@public.gmane.org Subject: Re: No module named lib.base?

On Nov 27, 2006, at 11:11 AM, John_Nowlan wrote:

I installed pylons 0.9.3

Created a new-app hello.py works

but when copying my old-app files to new-app and changing references I get the following error when trying to hit the controller:

File 'C:\\Python24\\lib\\site-packages\\myghty-1.1-py2.4.egg\\myghty \\importer.py', line 54 in import_module return builtin_importer(name, globals, locals, fromlist) File 'C:\\Inetpub\\pylonshome\\banner\\banner\\controllers\ \banner.py', line 1 in ? from banner.lib.base import * File 'C:\\Python24\\lib\\site-packages\\myghty-1.1-py2.4.egg\\myghty \\importer.py', line 54 in import_module return builtin_importer(name, globals, locals, fromlist) ImportError: No module named lib.base

You can't have a controller module named the same as your webapp's package. This is a python problem -- in this case, it is assumes 'banner' refers to the controller module (a relative import) as opposed to your top level package (an absolute import).