https://pulumi.com logo
Title
t

thankful-stone-34269

01/09/2023, 8:47 PM
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

jolly-fall-57688

01/09/2023, 8:51 PM
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

thankful-stone-34269

01/09/2023, 8:54 PM
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

jolly-fall-57688

01/09/2023, 8:57 PM
Are you using python virtual environments? That is all I am using, pretty much cookie cutter environment.
t

thankful-stone-34269

01/09/2023, 8:58 PM
I use conda/mamba normally. And that interaction is perhaps why things are going south.
r

red-match-15116

01/09/2023, 10:21 PM
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

thankful-stone-34269

01/09/2023, 10:23 PM
That worked. Thanks.
r

red-match-15116

01/09/2023, 10:23 PM
This doc has some info about how to handle your python environment https://www.pulumi.com/docs/intro/languages/python/#pypi-packages
b

billowy-army-68599

01/09/2023, 10:23 PM
@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

thankful-stone-34269

01/09/2023, 10:25 PM
Makes sense - I appreciate it.
w

worried-rain-74420

01/10/2023, 5:57 AM
pulumi-language-python-exec is the language host, which is responsible for booting the Python interpreter and connecting it to the Pulumi CLI.