I'm having some issues getting my Python virtual e...
# aws
r
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
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
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
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
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
I usually have multiple projects with the same requirements and I remove venv from pulumi.yaml
r
Yeah, that's not a bad idea