Thread
#python
    s

    steep-lamp-20408

    5 days ago
    Hi all, I have a Pulumi script
    __main__.py
    working fine, executed with
    pulumi up
    CLI command. In that script I need to use the Python
    toml
    module, so I installed it the project dependencies and venv. Now, when I do
    pulumi up
    , I get the error:
    import toml
    ModuleNotFoundError: No module named 'toml'
    (needless to say everything is done in a venv where I double checked that
    toml
    was actually installed, with
    pip list
    ). It would seem that it’s not supported by Pulumi to use third-party Python modules in a Pulumi script? Or did I miss something?
    b

    billowy-army-68599

    5 days ago
    is it installed in your virtualenv?
    venv/bin/pip3 install toml
    s

    steep-lamp-20408

    5 days ago
    Yes
    My question is about the import of modules in pulumi scripts. I’m familiar with venvs.
    pip list
    shows
    toml
    . Will edit my question
    b

    billowy-army-68599

    5 days ago
    can you share your
    Pulumi.yaml
    ?
    s

    steep-lamp-20408

    5 days ago
    can you share your
    Pulumi.yaml
    ?
    Oh thanks, I think it might be very probably because of that. My
    Pulumi.yaml
    doesn’t point to the same venv.
    I’m sharing it anyway but pretty sure that’s the issue:
    name: myproject
    runtime:
      name: python
      options:
        virtualenv: .venv
    description: myproject description
    b

    billowy-army-68599

    5 days ago
    🙂
    s

    steep-lamp-20408

    5 days ago
    Will sort that out! Thanks again