Hi all, I have a Pulumi script `__main__.py` work...
# python
s
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:
Copy code
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
is it installed in your virtualenv?
venv/bin/pip3 install toml
s
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
can you share your
Pulumi.yaml
?
s
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:
Copy code
name: myproject
runtime:
  name: python
  options:
    virtualenv: .venv
description: myproject description
b
🙂
s
Will sort that out! Thanks again