question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(aws_cdk): AttributeError: module 'constructs' has no attribute 'ISynthesisSession'

See original GitHub issue

What is the problem?

Upgraded cdk to v1.33.0 and when I try to synthesise a project I get the following error:

Traceback (most recent call last): File “/Users/myusername/repos/cdk_myproject/app.py”, line 2, in <module> from aws_cdk import ( File “/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aws_cdk/aws_ec2/init.py”, line 1443, in <module> from ._jsii import * File “/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aws_cdk/aws_ec2/_jsii/init.py”, line 11, in <module> import aws_cdk.aws_cloudwatch._jsii File “/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aws_cdk/aws_cloudwatch/init.py”, line 495, in <module> from ._jsii import * File “/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aws_cdk/aws_cloudwatch/_jsii/init.py”, line 11, in <module> import aws_cdk.aws_iam._jsii File “/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aws_cdk/aws_iam/init.py”, line 484, in <module> from ._jsii import * File “/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aws_cdk/aws_iam/_jsii/init.py”, line 11, in <module> import aws_cdk.core._jsii File “/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aws_cdk/core/init.py”, line 17379, in <module> class Construct( File “/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/aws_cdk/core/init.py”, line 17432, in Construct def _on_synthesize(self, session: constructs.ISynthesisSession) -> None: AttributeError: module ‘constructs’ has no attribute ‘ISynthesisSession’ Subprocess exited with error 1

Reproduction Steps

mkdir test
cd test
cdk init --language=python
cdk synth

What did you expect to happen?

The code to be synthesised.

What actually happened?

See the error

CDK CLI Version

1.133.0 (build 2dea31a)

Framework Version

No response

Node.js Version

v14.17.0

OS

macOS 12.0.1 21A559 x86_64

Language

Python

Language Version

3.9.5

Other information

python3 -m pip list --format=freeze | grep -i cdk

aws-cdk.assets==1.133.0 aws-cdk.aws-acmpca==1.133.0 aws-cdk.aws-apigateway==1.133.0 aws-cdk.aws-applicationautoscaling==1.133.0 aws-cdk.aws-autoscaling==1.133.0 aws-cdk.aws-autoscaling-common==1.133.0 aws-cdk.aws-autoscaling-hooktargets==1.133.0 aws-cdk.aws-certificatemanager==1.133.0 aws-cdk.aws-cloudformation==1.133.0 aws-cdk.aws-cloudfront==1.133.0 aws-cdk.aws-cloudwatch==1.133.0 aws-cdk.aws-codebuild==1.133.0 aws-cdk.aws-codecommit==1.133.0 aws-cdk.aws-codeguruprofiler==1.133.0 aws-cdk.aws-codepipeline==1.133.0 aws-cdk.aws-codestarnotifications==1.133.0 aws-cdk.aws-cognito==1.133.0 aws-cdk.aws-ec2==1.133.0 aws-cdk.aws-ecr==1.133.0 aws-cdk.aws-ecr-assets==1.133.0 aws-cdk.aws-ecs==1.133.0 aws-cdk.aws-efs==1.133.0 aws-cdk.aws-elasticloadbalancing==1.133.0 aws-cdk.aws-elasticloadbalancingv2==1.133.0 aws-cdk.aws-events==1.133.0 aws-cdk.aws-events-targets==1.133.0 aws-cdk.aws-globalaccelerator==1.133.0 aws-cdk.aws-iam==1.133.0 aws-cdk.aws-kinesis==1.133.0 aws-cdk.aws-kinesisfirehose==1.133.0 aws-cdk.aws-kms==1.133.0 aws-cdk.aws-lambda==1.133.0 aws-cdk.aws-lambda-destinations==1.133.0 aws-cdk.aws-lambda-python==1.133.0 aws-cdk.aws-logs==1.133.0 aws-cdk.aws-route53==1.133.0 aws-cdk.aws-route53-targets==1.133.0 aws-cdk.aws-s3==1.133.0 aws-cdk.aws-s3-assets==1.133.0 aws-cdk.aws-sam==1.133.0 aws-cdk.aws-secretsmanager==1.133.0 aws-cdk.aws-servicediscovery==1.133.0 aws-cdk.aws-signer==1.133.0 aws-cdk.aws-sns==1.133.0 aws-cdk.aws-sns-subscriptions==1.133.0 aws-cdk.aws-sqs==1.133.0 aws-cdk.aws-ssm==1.133.0 aws-cdk.aws-stepfunctions==1.133.0 aws-cdk.cloud-assembly-schema==1.133.0 aws-cdk.core==1.133.0 aws-cdk.custom-resources==1.133.0 aws-cdk.cx-api==1.133.0 aws-cdk.region-info==1.133.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
Shadab995commented, Aug 17, 2022

I am still facing the same issue and I haven’t upgraded anything just used the cdk version:2.38.0.

Can you please help me with that

1reaction
wolf-allywilsoncommented, Nov 23, 2021

Nevermind, removed all the pip modules and installed them again. Something must have went wrong with an upgrade I imagine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

interface ISynthesisSession · AWS CDK
Represents a single session of synthesis. Passed into Construct.synthesize() methods. Properties. Name, Type, Description. assembly ...
Read more >
Facing issues in installing packages in aws cdk - Stack Overflow
CDK dependencies have changed between V1 and the recently released CDK V2. Make sure you are not mixing V1 and V2 dependencies.
Read more >
CDK on local environment issue | AWS re:Post
For context, I am running CDK v2, I have a Windows device, I have Python 3.7.9 ... IDependable] = None, AttributeError: module 'constructs'...
Read more >
awslabs/aws-cdk - Gitter
AttributeError : module 'aws_cdk.core' has no attribute 'IInspectable'. Here's the traceback: Traceback (most recent call last): File "app.py", line 6, ...
Read more >
How to upgrade CDK from CDKv1 to CDKv2 in an existing ...
When working with CDK version 1, every package/module which is needed ... In the setup.py file the aws-cdk-lib and construct packages are ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found