Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 1
    Thanks and yes, I had __init__.py. The problem this time was with $PYTHONPATH. Ignacio's solution worked. Commented Feb 24, 2010 at 13:08
  • 2
    The init.py files are required to make Python treat the directories as containing packages; this is done to prevent directories with a common name, such as string, from unintentionally hiding valid modules that occur later on the module search path. In the simplest case, init.py can just be an empty file Commented Jan 14, 2016 at 21:13
  • __init__.py has nothing to do with making absolute imports work, and has not been required to make relative imports work since 3.3. Commented Jan 14, 2024 at 22:35