https://pulumi.com logo
#python
Title
# python
s

shy-author-33795

04/28/2021, 5:42 PM
I'm having a hard time getting my pulumi program to recognized that I have
pulumi_docker
installed on my system. I have the following in my programs requirements.txt:
Copy code
pulumi>=3.0.0,<4.0.0
pulumi_docker>=3.0.0,<4.0.0
pulumi-aws>=4.0.0,<5.0.0
pylint>=2.7.4
And at the top of my program's main.py I have:
Copy code
from pulumi_aws import ecr
from pulumi_docker import Image, DockerBuild
I'm not sure why
pulumi_aws
works, but
pulumi_docker
does not. Any chance you all could help resolve this error:
Copy code
ModuleNotFoundError: No module named 'pulumi_docker'
b

billowy-army-68599

04/28/2021, 5:43 PM
hi Elena, every time I've seen this it's because the module isn't installed in the virtualenv. Can you makre sure it's activated?
Copy code
source venv/bin/activate
pip3 install pulumi_docker`
Pulumi automatically creates a venv for you when you create a new project
s

shy-author-33795

04/28/2021, 5:46 PM
I have the package installed in the virtualenv, but still no luck
b

billowy-army-68599

04/28/2021, 5:47 PM
can you share your
Pulumi.yaml
?
s

shy-author-33795

04/28/2021, 5:49 PM
I'm uninstalling everything and reinstalling to see if I can get in a state where
pulumi_aws
and
pulumi_docker
but I'm still having the same issue.
Here's my Pulumi.yaml
Copy code
name: ecr
runtime:
  name: python
  options:
    virtualenv: venv
description: ECR repos
b

billowy-army-68599

04/28/2021, 5:50 PM
huh, how very curious. Which OS?
s

shy-author-33795

04/28/2021, 5:51 PM
b

billowy-army-68599

04/28/2021, 5:51 PM
would you be open to screen sharing so we can figure it out? I'm free after lunch PST
s

shy-author-33795

04/28/2021, 5:51 PM
sure! that would be great!
also, I really enjoyed the "Build a Self-Service Infrastructure Platform with Python" workshop you led last week. Thank you so much for that
b

billowy-army-68599

04/28/2021, 6:01 PM
my pleasure! can you DM me an email and I'll send you a zoom link
1
s

shy-author-33795

04/28/2021, 11:35 PM
The solution here was removing my venv folder and recreating it with
$ python3 -m venv venv
❤️ 1