简体   繁体   English

AWS CDK - 导入错误:无法从“aws_cdk.cloud_assembly_schema”导入名称“AssetManifestOptions”

[英]AWS CDK - ImportError: cannot import name 'AssetManifestOptions' from 'aws_cdk.cloud_assembly_schema'

When trying to synthesize my CDK app, I receive the following error: `尝试合成我的 CDK 应用程序时,我收到以下错误:`

Traceback (most recent call last):
  File "C:\Users\myusername\PycharmProjects\rbds-cdk_testing\app.py", line 2, in <module>
    from aws_cdk.core import App, Environment
  File "C:\Users\myusername\PycharmProjects\rbds-cdk_testing\.venv\lib\site-packages\aws_cdk\__init__.py", line 1260, in <module>
    from .cloud_assembly_schema import (
ImportError: cannot import name 'AssetManifestOptions' from 'aws_cdk.cloud_assembly_schema' (C:\Users\myusername\PycharmProjects\rbds-cdk_testing\.venv\lib\site-packages\aws_cdk\cloud_assembly_schema\__init__.py)

I am using node version 18.0.0.我正在使用节点版本 18.0.0。 Here's the steps I've done in creating my CDK app:以下是我在创建 CDK 应用程序时所做的步骤:

(FROM c:\Users\myusername\) 
installed nvm
installed npm 
nvm use 18.0.0
npm install -g yarn
npm install -g aws-cdk
cdk bootstrap aws://account-number/region 
cd .\PyCharmProjects\mycdkapp 
cdk init app --language python 
.venv\Scripts\activate.bat 
python -m pip install aws-cdk.aws-glue 
python -m pip install aws-cdk

I error out even when executing cdk ls as the runtime tries to run app.py which contains \我什至在执行cdk ls时出错,因为运行时尝试运行包含 \

import yaml
from aws_cdk.core import App, Environment
from pipeline import PipelineCDKStack


In checking whether the init .py file for aws_cdk contains AssetManifestOptions, I've discovered it is completely missing:在检查 aws_cdk 的init .py 文件是否包含 AssetManifestOptions 时,我发现它完全丢失了: 在此处输入图像描述

Am I missing something here or is this a unique bug that I am experiencing?我在这里遗漏了什么或者这是我遇到的一个独特的错误吗? Any help much appreciated.非常感谢任何帮助。 I am banging my head on this one.我正在努力解决这个问题。

Its the same here, I think the issue can be in wrong package version.这里也是一样,我觉得问题可能出在错误的package版本上。 cloud-assembly-schema==2.50.0 contains AssetManifestOptions. cloud-assembly-schema==2.50.0 包含 AssetManifestOptions。 Can you please paste here output of你能把output贴在这里吗

pip list -v | grep aws

Iam able to install 2.50.0, however it depends on other packages of the same version (see attach)我能够安装 2.50.0,但是它依赖于相同版本的其他包(见附件) 在此处输入图像描述 And I cant set up core package because there is no CDKv2 matching distribution at the moment而且我无法设置核心 package 因为目前没有 CDKv2 匹配分布在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM