导入aws_cdk核心会导致跨接口TypeError

时间:2019-07-16 12:02:09

标签: amazon-web-services aws-cdk

我有一个CDK项目,初始化为:

cdk init --language python

我通过(Windows 10)激活.env

call ./.env/scripts/activate

我有Anaconda风味的Python 3.6

我安装了部门...

pip install -r requirements.txt

这时,所有与cdk相关的命令都导致相同的错误:

C:\...\.env\lib\site-packages\aws_cdk\core\__init__.py", line 1554, in <module>
    class DependableTrait(metaclass=jsii.JSIIAbstractClass, jsii_type="@aws-cdk/core.DependableTrait"):
TypeError: __new__() got an unexpected keyword argument 'jsii_type'

我可以从以下那里得到这个

cdk ls

# or
cdk diff

# or
python -c "from aws_cdk import core"

1 个答案:

答案 0 :(得分:0)

我通过将Anaconda风格的Python转换为Python 3.7来解决此问题

完成此操作后,上面列出的所有步骤对我都有效。