The pulumi CLI/engine is different from the pulumi...
# python
f
The pulumi CLI/engine is different from the pulumi SDK. You
brew install pulumi
to obtain the CLI whereas
pulumi
in your requirements.txt refers to the Python-specific SDK. When you run
pulumi up
it spins up both the engine and a language host. The latter executes your python program within your specified python environment. The diagram in https://www.pulumi.com/docs/intro/concepts/how-pulumi-works/ provides a useful diagram and more details.
r
Thanks for the help! Then I still wonder, why
prefect_kubernetes
can not be imported, as it is installed in my conda environment, and if I understand the pulumi setup correctly, it should therefore be loaded from the conda environment, right? 🤔
f
Are you executing
pulumi
from within the shell that has an active conda environment?
r
Yes, but it doesn’t seem to load the packages from the conda environment
So I installed pulumi-kubernetes in my main mac python (additional to the conda environment) and this workaround works, thus showing that the conda environment packages are not loaded when running pulumi up…
f
Pulumi doesn’t try to do anything special from a python environment perspective. It picks up the first
python
on your
PATH
(see https://github.com/pulumi/pulumi/blob/b364296521a8b945ab37874f5c79de770d29d718/sdk/python/python.go#L32) If you’re able to provide a reliable repro of not using the right python (and right virtual environment), I’d be happy to take a look.