I got errors when I use pulumi up. ``` Traceba...
# general
w
I got errors when I use pulumi up.
Copy code
Traceback (most recent call last):
      File "/home/ubuntu/.pulumi/bin/pulumi-language-python-exec", line 14, in <module>
        import pulumi
    ModuleNotFoundError: No module named 'pulumi'
    It looks like the Pulumi SDK has not been installed. Have you run pip install?
    If you are running in a virtualenv, you must run pip install -r requirements.txt from inside the virtualenv.

    error: an unhandled error occurred: Program exited with non-zero exit code: 1
I use the setup.py install requirements.txt. Below is the code. (pip install .) /usr/bin/python3 -V Python 3.9.15
Copy code
#!/usr/bin/python3
import os
import setuptools

packages_path = os.path.join(os.getcwd(), "_install")

with open(os.path.join(os.getcwd(), "_install", "requirements.txt")) as f:
    required = f.read().splitlines()

setuptools.setup(
    name="deployment",
    version="1.4.1",
    author_email="email address",
    description="service to create clusters and other common infrastructure",
    url="URL",
    include_package_data=True,
    package_dir={"": "src"},
    packages=setuptools.find_packages(where="src"),
    install_requires=[
        required,
    ],
    extras_require={
        "dev": [
            f"common_variables[dev] "
            f"@ <file://localhost/{packages_path}/common_variables-1.4.5.tar.gz#egg=common_variables>",
        ],
    }
)
Copy code
pip freeze
Arpeggio==1.10.2
attrs==19.3.0
Automat==0.8.0
blinker==1.4
certifi==2019.11.28
chardet==3.0.4
Click==7.0
cloud-init==22.3.4
colorama==0.4.3
configobj==5.0.6
constantly==15.1.0
cryptography==2.8
dbus-python==1.2.16
deployment==1.4.1
dill==0.3.5.1
distro==1.4.0
distro-info===0.23ubuntu1
ec2-hibinit-agent==1.0.0
entrypoints==0.3
grpcio==1.47.0
httplib2==0.14.0
hyperlink==19.0.0
idna==2.8
importlib-metadata==1.5.0
incremental==16.10.1
Jinja2==2.10.1
jsonpatch==1.22
jsonpointer==2.0
jsonschema==3.2.0
keyring==18.0.1
launchpadlib==1.10.13
lazr.restfulclient==0.14.2
lazr.uri==1.0.3
MarkupSafe==1.1.0
more-itertools==4.2.0
netifaces==0.10.4
oauthlib==3.1.0
parver==0.3.1
pexpect==4.6.0
protobuf==4.21.7
pulumi==3.43.1
pulumi-aws==5.16.2
pulumi-docker==3.4.1
pyasn1==0.4.2
pyasn1-modules==0.2.1
PyGObject==3.36.0
PyHamcrest==1.9.0
PyJWT==1.7.1
pymacaroons==0.13.0
PyNaCl==1.3.0
pyOpenSSL==19.0.0
pyrsistent==0.15.5
pyserial==3.4
python-apt==2.0.0+ubuntu0.20.4.8
python-debian===0.1.36ubuntu1
python-dotenv==0.21.0
PyYAML==6.0
requests==2.22.0
requests-unixsocket==0.2.0
SecretStorage==2.3.1
semver==2.13.0
service-identity==18.1.0
simplejson==3.16.0
six==1.14.0
sos==4.3
ssh-import-id==5.10
systemd-python==234
Twisted==18.9.0
ufw==0.36
urllib3==1.25.8
wadllib==1.3.3
zipp==1.0.0
zope.interface==4.7.1
b
is it installed in your virtual env? can you show me your
Pulumi.yaml
?
w
Copy code
cat Pulumi.yaml
name: app-cluster
runtime:
  name: python
  options:
    virtualenv: venv
description: ECS cluster for public-facing web apps and services
b
okay, have you installed your dependencies in the
venv
?
try
venv/bin/pip3 install pulumi pulumi_aws
w
Added the code.
Copy code
python3 -m venv venv
source venv/bin/activate
venv/bin/pip3 install pulumi pulumi_aws
venv/bin/pip3 install .
pulumi up I got error: failed to discover plugin requirements: installing dependencies via '/home/ubuntu/cloud/deployment/src/app_cluster/venv/bin/python -m pip install -r requirements.txt': exit status 1
I got
Copy code
Traceback (most recent call last):
      File "/home/ubuntu/.pulumi/bin/pulumi-language-python-exec", line 14, in <module>
        import pulumi
    ModuleNotFoundError: No module named 'pulumi'
    It looks like the Pulumi SDK has not been installed. Have you run pip install?
    If you are running in a virtualenv, you must run pip install -r requirements.txt from inside the virtualenv.
Did that mean I cannot use setup.py to install. I have to use pip install -r requirements.txt to install. Refer to my code.
830 Views