title: Why do circular imports seemingly work further up in the call stack but then raise an ImportError further down?
body: <p>I'm getting this error</p>
  <pre><code>Traceback (most recent call last):
    File &quot;/Users/alex/dev/runswift/utils/sim2014/simulator.py&quot;, line 3, in &lt;module&gt;
      from world import World
    File &quot;/Users/alex/dev/runswift/utils/sim2014/world.py&quot;, line 2, in &lt;module&gt;
      from entities.field import Field
    File &quot;/Users/alex/dev/runswift/utils/sim2014/entities/field.py&quot;, line 2, in &lt;module&gt;
      from entities.goal import Goal
    File &quot;/Users/alex/dev/runswift/utils/sim2014/entities/goal.py&quot;, line 2, in &lt;module&gt;
      from entities.post import Post
    File &quot;/Users/alex/dev/runswift/utils/sim2014/entities/post.py&quot;, line 4, in &lt;module&gt;
      from physics import PostBody
    File &quot;/Users/alex/dev/runswift/utils/sim2014/physics.py&quot;, line 21, in &lt;module&gt;
      from entities.post import Post
  ImportError: cannot import name Post
  </code></pre>
  <p>and you can see that I use the same import statement further up and it works. Is there some unwritten rule about circular importing? How do I use the same class further down the call stack?</p>
  <hr />
  <p><sub>See also <a href="https://stackoverflow.com/questions/744373">What happens when using mutual or circular (cyclic) imports in Python?</a> for a general overview of what is allowed and what causes a problem WRT circular imports. See <a href="https://stackoverflow.com/questions/9252543/">What can I do about &quot;ImportError: Cannot import name X&quot; or &quot;AttributeError: ... (most likely due to a circular import)&quot;?</a> for techniques for resolving and avoiding circular dependencies.</sub></p>