Thread
#getting-started
    a

    average-article-76176

    6 months ago
    Couldn't find this info in the docs.. In Python, my
    __main__.py
    simply imports other modules and the project contains other modules still. However, Pulumi seems to require all the
    __init__.py
    to import modules, or else Pulumi doesn't import them. Is this correct? I need to explicitly import all modules and packages in each package's
    __init__.py
    ? If so, is there a better / more standardized way?
    s

    stocky-wire-60053

    6 months ago
    There is nothing special about Pulumi and the import process. Once you import main.py, it is just Python code at that point that follows standard rules for imports. I use imports regularly and my init.py files are all empty. I suspect there is something about your project setup. I would recommend the use of a tool like
    pyscaffold
    to set up your project -- it tends to put everything in the correct place and generally takes care of most people's import issues.
    n

    numerous-state-84361

    6 months ago
    Correct, this is a
    python
    item and not
    pulumi
    . If the other modules exists in other directories, then those directories must have an
    ___init.py___
    file. This is what tells python it is a package/module.