(aws_cdk): AttributeError: module 'constructs' has no attribute 'ISynthesisSession'
See original GitHub issueWhat 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:
- Created 2 years ago
- Comments:5
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
Nevermind, removed all the pip modules and installed them again. Something must have went wrong with an upgrade I imagine.