Difference between using Intellij modules and Python packages within project

 

I have an Intellij project that contains 3 different components to it, all written in Python. I want to import .py files between the three components, but this only seems to work when the components are set up as directories rather than Intellij modules. Not pictured, but I did add __init__.py files to each of the module directories (foo, bar, baz) and no luck.

Import using modules: https://imgur.com/rhNKC3X

Import using packages: https://imgur.com/qQvY55D

Why don't imports seem to work for Python modules? Are they even necessary for Python projects? Maybe I'm misunderstanding the reason to create IntelliJ modules in the first place for this type of project.

Please sign in to leave a comment.