https://pulumi.com logo
#aws
Title
# aws
r

rhythmic-arm-71682

03/04/2024, 4:18 PM
I'm having some issues getting my Python virtual environment (or just the python in the OS, itself) to recognize pulumi_awsx and pulumi_eks. I've installed both through pip and doing a 'pip list' shows pulumi_awsx = 2.5.0 and pulumi_eks = 2.2.1 Yet, while importing and running the modules doing a 'pulumi up', I get an error saying ModuleNotFoundError: No module named 'pulumi_eks'. Anyone else have this issue?
a

ancient-policeman-24615

03/04/2024, 4:42 PM
Is your Pulumi project using a virtual environment? If you install
pulumi_awsx
globally but Pulumi is trying to use a local environment that could cause this problem.
r

rhythmic-arm-71682

03/04/2024, 7:18 PM
That might be it, I did install globally. But also have installed locally in the venv too. Running Pulumi in an the venv or outside the venv gives me the same issue
g

great-sunset-355

03/05/2024, 6:37 AM
This is the worst attribute(trap) of Python. One should never install anything in the system(global) python. I'd recommend organizing Python versions via
asdf
or a different Python manager just to avoid system python at all costs. I use
asdf
to install python version and then venvs for each project.
poetry
or
pdm
to manage venv and deps.
r

rhythmic-arm-71682

03/05/2024, 1:37 PM
Yeah, learning the hard way Jan. Thanks!
Looks like I have my issue fixed. My pulumi.yaml points to 'venv'. My 'venv' did not have pulumi_eks installed. I had a couple other virtual environments in that folder that I ran on that did. I renamed one of those environments to venv as the pulumi.yaml has listed and removed all other environments. Now I can see it.
g

great-sunset-355

03/05/2024, 10:39 PM
I usually have multiple projects with the same requirements and I remove venv from pulumi.yaml
r

rhythmic-arm-71682

03/08/2024, 1:49 PM
Yeah, that's not a bad idea