Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running cdk bootstrap #11219

Closed
deccy-mcc opened this issue Oct 30, 2020 · 6 comments · Fixed by aws/jsii#2212
Closed

Error running cdk bootstrap #11219

deccy-mcc opened this issue Oct 30, 2020 · 6 comments · Fixed by aws/jsii#2212
Assignees
Labels
bug This issue is a bug. dependencies This issue is a problem in a dependency or a pull request that updates a dependency file. language/python Related to Python bindings p1

Comments

@deccy-mcc
Copy link

We have just started getting this error running cdk bootstrap -

  • cdk bootstrap --context Version=OurVersion --context Environment=OurEnvironment --context DeploymentType=Full
    Traceback (most recent call last):
    File "app.py", line 3, in
    from aws_cdk import core
    File "/usr/local/lib/python3.6/site-packages/aws_cdk/core/init.py", line 904, in
    import jsii
    File "/usr/local/lib/python3.6/site-packages/jsii/init.py", line 4, in
    from ._runtime import (
    File "/usr/local/lib/python3.6/site-packages/jsii/_runtime.py", line 10, in
    from ._kernel import Kernel
    File "/usr/local/lib/python3.6/site-packages/jsii/_kernel/init.py", line 15, in
    from .providers import BaseProvider, ProcessProvider
    File "/usr/local/lib/python3.6/site-packages/jsii/_kernel/providers/init.py", line 2, in
    from .process import ProcessProvider
    File "/usr/local/lib/python3.6/site-packages/jsii/_kernel/providers/process.py", line 16, in
    import cattr # type: ignore
    File "/usr/local/lib/python3.6/site-packages/cattr/init.py", line 1, in
    from .converters import Converter, GenConverter, UnstructureStrategy
    File "/usr/local/lib/python3.6/site-packages/cattr/converters.py", line 18, in
    from ._compat import (
    File "/usr/local/lib/python3.6/site-packages/cattr/_compat.py", line 31, in
    from typing import get_args, get_origin # NOQA
    ImportError: cannot import name 'get_args'
    Subprocess exited with error 1

I have tried pinning the version of aws_cdk and the python libraries we use to 1.70.0 (which worked yesterday), but we still get the same error.

Any help would be appreciated.

@deccy-mcc
Copy link
Author

UPDATE:

We discovered that the library cattrs has also been updated since yesterday, specifying the previous version of cattrs (1.0.0) in our pip install has allowed us to get around the issue for now.

I assume there is an incompatibility between the latest version of cdk and cattrs

@jaystary
Copy link

I had the same problem with 3.6.11 - changing the python version (in my case 3.8.3) fixed the issue for me.

@jorgenfroland
Copy link

I aslo got this error on python 3.6.8 (Windows 10) after upgrading to aws cdk 1.71.0. I also fixed this by downgrading cattrs to 1.0.0. Looks like 1.1.0 (which was installed) is yanked, but Im not able to install 1.1.1. Got this error: ERROR: No matching distribution found for cattrs==1.1.1. So not able to verify if 1.1.1 is compatible.

RomainMuller added a commit to aws/jsii that referenced this issue Nov 2, 2020
It so happens cattrs 1.1.0 drops support for python 3.6, and can hence
no longer be used with jsii (since we support Python >= 3.6). Pinning
to the 1.0.0, while allowing patch updates.

Fixes aws/aws-cdk#11219
RomainMuller added a commit to aws/jsii that referenced this issue Nov 2, 2020
`cattrs>=1.1.0` dropped support for python 3.6, and added support for
python 3.9. Consequently, declare a dependency on `cattrs~=1.0.0` when
the python runtime is `< 3.7`, and on `cattrs~=1.1.0` when the python
runtime is `>= 3.7` in order to get the correct dependency brought in.

Fixes aws/aws-cdk#11219
@RomainMuller
Copy link
Contributor

RomainMuller commented Nov 2, 2020

The issue is [email protected] dropped support for Python 3.6. I'm preparing a PR to fix this issue by declaring a platform-dependent dependency...

A workaround in the meantime is to use Python >= 3.7; or to manually downgrade cattrs to 1.0.0.

RomainMuller added a commit to aws/jsii that referenced this issue Nov 2, 2020
`cattrs>=1.1.0` dropped support for python 3.6, and added support for
python 3.9. Consequently, declare a dependency on `cattrs~=1.0.0` when
the python runtime is `< 3.7`, and on `cattrs~=1.1.0` when the python
runtime is `>= 3.7` in order to get the correct dependency brought in.

Fixes aws/aws-cdk#11219
@RomainMuller RomainMuller self-assigned this Nov 2, 2020
@RomainMuller RomainMuller added language/python Related to Python bindings bug This issue is a bug. p1 dependencies This issue is a problem in a dependency or a pull request that updates a dependency file. labels Nov 2, 2020
@RomainMuller
Copy link
Contributor

By the way, @deccy-mcc - thank you very much for reporting this and your independent findings.

mergify bot pushed a commit to aws/jsii that referenced this issue Nov 2, 2020
`cattrs>=1.1.0` dropped support for python 3.6, and added support for
python 3.9. Consequently, declare a dependency on `cattrs~=1.0.0` when
the python runtime is `< 3.7`, and on `cattrs~=1.1.0` when the python
runtime is `>= 3.7` in order to get the correct dependency brought in.

Fixes aws/aws-cdk#11219

Caused by Tinche/cattrs@eb454d4

---

By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license].

[Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
@github-actions
Copy link

github-actions bot commented Nov 2, 2020

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

RomainMuller added a commit to aws/jsii that referenced this issue Nov 4, 2020
`cattrs>=1.1.0` dropped support for python 3.6, and added support for
python 3.9. Consequently, declare a dependency on `cattrs~=1.0.0` when
the python runtime is `< 3.7`, and on `cattrs~=1.1.0` when the python
runtime is `>= 3.7` in order to get the correct dependency brought in.

Fixes aws/aws-cdk#11219

Caused by Tinche/cattrs@eb454d4

---

By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license].

[Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. dependencies This issue is a problem in a dependency or a pull request that updates a dependency file. language/python Related to Python bindings p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants