[Tutor] ImportError
eryksun
eryksun at gmail.com
Tue Jul 31 18:26:14 CEST 2012
On Tue, Jul 31, 2012 at 10:32 AM, Tino Dai <oberoc at gmail.com> wrote:
>
> File "/home/tdai/ProjectOne-TNT/leg_apps/etl/transfers/__init__.py", line
> 8, in <module>
> from api import models
> File "/home/tdai/ProjectOne-TNT/leg_apps/api/models.py", line 20, in
> <module>
> from etl.transfers import eastern
> ImportError: cannot import name eastern
It looks to me like you have a circular import problem. Before the
etl.transfers package defines eastern it attempts to import
api.models, but executing the latter tries and fails to import (the as
yet undefined) eastern from etl.transfers. If this is the problem, you
could refactor the cyclic dependency into its own module, or move the
import to after eastern is defined, or do the import in
functions/methods that run after the modules have been loaded, etc.
More information about the Tutor
mailing list