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.

Python sample app is broken in 0.36.0

See original GitHub issue

Note: for support questions, please first reference our documentation, then use Stackoverflow. This repository’s issues are intended for feature requests and bug reports.

  • I’m submitting a …

    • 🪲 bug report
    • 🚀 feature request
    • 📚 construct library gap
    • ☎️ security issue or vulnerability => Please see policy
    • ❓ support request => Please see note at the top of this template.
  • What is the current behavior? If the current behavior is a 🪲bug🪲: Please provide the steps to reproduce Install cdk 0.3.6

cdk init sample-app --language=python
source .env/bin/activate
python3 -m pip install -r requirements.txt 
cdk synth
Traceback (most recent call last):
  File "app.py", line 5, in <module>
    from hello.hello_stack import MyStack
  File "/home/ec2-user/environment/test2/hello/hello_stack.py", line 9, in <module>
    from hello_construct import HelloConstruct
  File "/home/ec2-user/environment/test2/hello/hello_construct.py", line 8, in <module>
    class HelloConstruct(cdk.Construct):
**AttributeError: module 'aws_cdk.cdk' has no attribute 'Construct'**
Subprocess exited with error 1
  • What is the expected behavior (or behavior of feature suggested)? cdk synth should succeed

  • What is the motivation / use case for changing the behavior or adding this feature?

  • Please tell us about your environment:

    • CDK CLI Version:0.36.0
    • Module Version: xx.xx.xx
    • OS: Amazon Linux (Code9)
    • Language: [Python ]
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. associated pull-request, stackoverflow, gitter, etc) It appears the change from aws-cdk.cdk in 0.36.0 broke the sample-app and needs to be updated.

It also appears there is a change to the sqs.Queue class that breaks hello_construct.py. Specicially, visibility_timeout_secs was renamed visbility_timeout and expects an object instead of int.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
senorkrabscommented, Jun 26, 2019

Same for me. I installed cdk this morning. At that time it was 0.35. I wrote my app modeled on the sample app. Later in the day, I had to install cdk for cloudformation. At that point my cdk got upgraded to 0.36. That time I got the same error.

To workaround in the sample app:

  • Change all imports of cdk, to core, in app.py, hello_construct.py, and hello_stack.py
  • Replace all cdk. to core. in the same 3 python scripts
  • Change visibility_timeout_secs=300 to visibility_timeout=core.Duration.seconds(300) in hello_construct.py
  • Replace App.run() with App.synth() at the end of the app.py script

Have fun!

1reaction
sdolecommented, Jun 26, 2019

Same for me. I installed cdk this morning. At that time it was 0.35. I wrote my app modeled on the sample app. Later in the day, I had to install cdk for cloudformation. At that point my cdk got upgraded to 0.36. That time I got the same error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

just upgraded to new version to dash - Plotly Python
My application worked fine until a few minutes ago. I upgraded the following: pip install dash==0.36.0 pip install ...
Read more >
awslabs/aws-cdk - Gitter
We've put together a sample app showing the problem here: ... CDK 0.33.0 divides up subnets differently to 0.36.0. The app above shows...
Read more >
How to make setup.py for standalone python application in a ...
With that directory (package) structure, in your app.py you should import as one of the following: from app.aaa.module_a import method1
Read more >
Support for 3D brain visualization in headless mode?
With the predefined mne-tools/mne-python-plot docker image I get the following error on a jupyter ... Reinstalling the application may fix this problem.
Read more >
Release Notes — django-allauth 0.43.0 documentation
For example, the social app model uses a many-to-many pointing to the sites model if the sites ... Django 1.7 / Python 3.2...
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