CDK on local environment issue

0

Whenever I attempt to run a cdk command on my local machine, I receive the following error. For context, I am running CDK v2, I have a Windows device, I have Python 3.7.9 and running cdk --version returns a 2.19.0. I have attempted uninstalling and reinstalling CDK multiple times. I would appreciate anyone's help. The same CDK repository works for my 2 other teammates as well.

Traceback (most recent call last):
  File "app.py", line 4, in <module>
    import aws_cdk as cdk
  File "C:\Users\dalade\AppData\Local\Programs\Python\Python37\lib\site-packages\aws_cdk\__init__.py", line 24257, in <module>       
    from . import aws_apigateway
  File "C:\Users\dalade\AppData\Local\Programs\Python\Python37\lib\site-packages\aws_cdk\aws_apigateway\__init__.py", line 1549, in <module>
    from ..aws_certificatemanager import ICertificate as _ICertificate_c194c70b
  File "C:\Users\dalade\AppData\Local\Programs\Python\Python37\lib\site-packages\aws_cdk\aws_certificatemanager\__init__.py", line 184, in <module>
    from ..aws_cloudwatch import (
  File "C:\Users\dalade\AppData\Local\Programs\Python\Python37\lib\site-packages\aws_cdk\aws_cloudwatch\__init__.py", line 500, in <module>
    from ..aws_iam import Grant as _Grant_a7ae64f8, IGrantable as _IGrantable_71c4f5de
  File "C:\Users\dalade\AppData\Local\Programs\Python\Python37\lib\site-packages\aws_cdk\aws_iam\__init__.py", line 654, in <module> 
    "policy_dependable": "policyDependable",
  File "C:\Users\dalade\AppData\Local\Programs\Python\Python37\lib\site-packages\aws_cdk\aws_iam\__init__.py", line 662, in AddToPrincipalPolicyResult
    policy_dependable: typing.Optional[constructs.IDependable] = None,
AttributeError: module 'constructs' has no attribute 'IDependable'
Subprocess exited with error 1
AWS
David A
gefragt vor 2 Jahren1353 Aufrufe
1 Antwort
0

Whenever I've had errors like that from CDK, it's been due a mismatch between the CLI and the construct libraries (although that's hopefully harder with CDK v2). Does pip list show any/all CDK libraries are at the same version as the CLI? Can you reproduce if you install in a clean virtual environment?

profile pictureAWS
EXPERTE
James_S
beantwortet vor 2 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen