[Tutor] Relative import help

Walter Prins wprins at gmail.com
Sun Sep 23 00:49:11 CEST 2012


Hi,

On 22 September 2012 11:56, Matthew Ngaha <chigga101 at gmail.com> wrote:
> from ..silverware import Silverware
> heres my error mesages: ...  ValueError: Attempted relative import in
> non-package

Just an off the cuff remark since no one else picked up on this, but
the above errir message to me implies there's possibly something wrong
with your __init__.py files that mark your packages.  Obviously if you
packages aren't considered to be packages by Python  (due to for
example incorrect naming of __init__.py)  then your relative import
stuff will NOT work...

Walter


More information about the Tutor mailing list