This message was deleted.
# general
s
This message was deleted.
r
Within same env This works perfectly fine
Copy code
(pyenv)  manjunath.kp@VER-BLR-LT2761  ~/transcode-aks  python
Python 3.10.9 (main, Dec 15 2022, 17:11:09) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pulumi_azuread as azuread
>>>
e
Are you sure the environment is activated before calling into pulumi? The engine doesn't automatically use venvs.
c
There is a
virtualenv
parameter which can be set in
Pulumi.yaml
under
runtime.options
. Ensure that points to your venv directory and you should be all set 🙂
r
@echoing-dinner-19531 Absolutely yes. Made sure multiple times. Even pulumi module outside the pyenv isnt installed. But that loads up fine. Only this module is giving error.
Copy code
manjunath.kp@VER-BLR-LT2761  ~/transcode-manifests  python3
Python 3.10.9 (main, Dec 15 2022, 17:11:09) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pulumi
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pulumi'
>>>
 manjunath.kp@VER-BLR-LT2761  ~/transcode-manifests  source ~/pyenv/bin/activate
(pyenv)  manjunath.kp@VER-BLR-LT2761  ~/transcode-manifests  python3
Python 3.10.9 (main, Dec 15 2022, 17:11:09) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pulumi
>>>
@creamy-agency-52831 Thanks, let me try that and get back to you.
Copy code
name: transcode-aks
runtime:
  name: python
  options:
    virtualenv: venv
description: A minimal Azure Native Python Pulumi program
@creamy-agency-52831 Specified, still the same issue.
c
The `Pulumi.yaml`described above points to a local directory, but the venv you mentioned previously lives in
~/pyenv
r
@creamy-agency-52831 Still the same.
Copy code
cat Pulumi.yaml
name: transcode-aks
runtime:
  name: python
  options:
    virtualenv: ~/pyenv
description: A minimal Azure Native Python Pulumi program
Copy code
pulumi up
Previewing update (aks-prod)

View Live: 
     Type                 Name                    Plan       Info
 +   pulumi:pulumi:Stack  transcode-aks-aks-prod  create     1 error


Diagnostics:
  pulumi:pulumi:Stack (transcode-aks-aks-prod):
    error: Program failed with an unhandled exception:
    Traceback (most recent call last):
      File "/Users/manjunath.kp/transcode-aks/./__main__.py", line 5, in <module>
        import pulumi_azuread as azuread
    ModuleNotFoundError: No module named 'pulumi_azuread'


(pyenv)  ✘ manjunath.kp@VER-BLR-LT2761  ~/transcode-aks  pip3 install pulumi_azuread
Requirement already satisfied: pulumi_azuread in /Users/manjunath.kp/pyenv/lib/python3.10/site-packages (5.34.0)
Requirement already satisfied: pulumi<4.0.0,>=3.0.0 in /Users/manjunath.kp/pyenv/lib/python3.10/site-packages (from pulumi_azuread) (3.52.1)
Requirement already satisfied: semver>=2.8.1 in /Users/manjunath.kp/pyenv/lib/python3.10/site-packages (from pulumi_azuread) (2.13.0)
Requirement already satisfied: parver>=0.2.1 in /Users/manjunath.kp/pyenv/lib/python3.10/site-packages (from pulumi_azuread) (0.4)
Requirement already satisfied: attrs>=19.2 in /Users/manjunath.kp/pyenv/lib/python3.10/site-packages (from parver>=0.2.1->pulumi_azuread) (22.1.0)
Requirement already satisfied: arpeggio>=1.7 in /Users/manjunath.kp/pyenv/lib/python3.10/site-packages (from parver>=0.2.1->pulumi_azuread) (2.0.0)
Requirement already satisfied: six~=1.12 in /Users/manjunath.kp/pyenv/lib/python3.10/site-packages (from pulumi<4.0.0,>=3.0.0->pulumi_azuread) (1.16.0)
Requirement already satisfied: grpcio==1.50 in /Users/manjunath.kp/pyenv/lib/python3.10/site-packages (from pulumi<4.0.0,>=3.0.0->pulumi_azuread) (1.50.0)
Requirement already satisfied: dill~=0.3 in /Users/manjunath.kp/pyenv/lib/python3.10/site-packages (from pulumi<4.0.0,>=3.0.0->pulumi_azuread) (0.3.6)
Requirement already satisfied: pyyaml~=6.0 in /Users/manjunath.kp/pyenv/lib/python3.10/site-packages (from pulumi<4.0.0,>=3.0.0->pulumi_azuread) (6.0)
Requirement already satisfied: protobuf~=4.21 in /Users/manjunath.kp/pyenv/lib/python3.10/site-packages (from pulumi<4.0.0,>=3.0.0->pulumi_azuread) (4.21.12)
(pyenv)  manjunath.kp@VER-BLR-LT2761  ~/transcode-aks  cat py
@creamy-agency-52831 Strange, I deactivated venv and installed dependencies on the OSX default pip and it is working fine now without venv.
For now, I am good. Thank you for your time.