I feel like this has to be an FAQ because I keep r...
# python
t
I feel like this has to be an FAQ because I keep running into it but googling isn't helping. I get
ModuleNotFoundError
when running
pulumi up
on built in libraries like
import pulumi_eks
j
What does 'pip list' return for you? If that library is not in the list you need to install it. https://pypi.org/project/pulumi-eks/
t
Yeah, I wish it was that simple. I have pip installed the missing library. But the pulumi CLI manages its own python environment somewhere. So when I run
pip install pulumi_eks
it goes into my python environment, not pulumi's.
There's this
.pulumi/bin/pulumi-language-python-exec
which I don't understand and seems to be broken for some reason.
And pulumi disables the
pdb
debugger so I can't just set a breakpoint and figure out what's wrong.
j
Are you using python virtual environments? That is all I am using, pretty much cookie cutter environment.
t
I use conda/mamba normally. And that interaction is perhaps why things are going south.
r
To use the built-in virtual env with the pulumi program you would do something like
venv/bin/pip install pulumi_eks
in the root of the pulumi program.
t
That worked. Thanks.
r
This doc has some info about how to handle your python environment https://www.pulumi.com/docs/intro/languages/python/#pypi-packages
b
@thankful-stone-34269 to elaborate, by default when you do
pulumi new python
it creates a virtual env that it looks for (you can see the path to it in
Pulumi.yaml
If you’re using
conda
you may not want to use the venv
t
Makes sense - I appreciate it.
w
pulumi-language-python-exec is the language host, which is responsible for booting the Python interpreter and connecting it to the Pulumi CLI.