https://pulumi.com logo
Title
t

thankful-stone-34269

11/09/2022, 7:35 PM
Howdy folks. We're having trouble getting pulumi-python to work right. We keep getting module not found errors. We use several different ways to manage our python environments - conda, pyenv, poetry.
e.g. when we run
pulumi up
we're getting
ModuleNotFoundError: No module named 'pulumi_azure'
I run
pip install pulumi-azure
and that succeeds, but I still get the error. But I think the problem is when I run
pulumi
CLI, it's using whatever version of python it decided to use when I installed the CLI, not the python env my bash is connected to. How do I get my pulumi CLI to sync with my python environment?
What I'd love is if
pip install pulumi
is how the CLI installed. And then when I ran
pulumi up
it just runs the pulumi from the current python environment. Managing python environments is complicated. The fact that the CLI lives in its own python environment is pretty confusing.
b

billowy-army-68599

11/09/2022, 7:41 PM
what does your
Pulumi.yaml
say? it should be pointing to a
venv
which you may need to change?
t

thankful-stone-34269

11/09/2022, 7:42 PM
Thanks for the pointer. Yeah, it says
virtualenv: venv
- so that's where I need to pip install the libraries?
Okay that fixed it. Thanks! But there's clearly a bug in the azure-python scaffolding.
After activating the venv and running
pip install -r requirements.txt
I still don't get
pulumi-azure
module. requirements.txt has
pulumi-azure-native>=1.0.0,<2.0.0
but I needed to
pip install pulumi-azure
explicitly before it would work.