ImportError:无法从“ botocore.docs.bcdoc”
(/ python3.7 / site-packages / botocore / docs / bcdoc / init .py)中导入名称“ docevents”
Traceback (most recent call last):
File "/root/.pyenv/versions/3.7.6/bin/aws", line 19, in <module>
import awscli.clidriver
File "/root/.pyenv/versions/3.7.6/lib/python3.7/site-packages/awscli/clidriver.py", line 36, in <module>
from awscli.help import ProviderHelpCommand
File "/root/.pyenv/versions/3.7.6/lib/python3.7/site-packages/awscli/help.py", line 23, in <module>
from botocore.docs.bcdoc import docevents
ImportError: cannot import name 'docevents' from 'botocore.docs.bcdoc' (/root/.pyenv/versions/3.7.6/lib/python3.7/site-packages/botocore/docs/bcdoc/__init__.py)
[Container] 2020/10/29 16:48:39 Command did not exit successfully aws --version exit status 1
该失败发生在PRE_BUILD中。
这是我的规范构建文件:buildspec-cd.yml
pre_build:
commands:
- AWS_REGION=${AWS_DEFAULT_REGION}
- COMMIT_HASH=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7)
- IMAGE_VERSION=${COMMIT_HASH}
- REPOSITORY_URI=${CONTAINER_REGISTRY}/${APPLICATION_NAME}
- aws --version
- echo Logging in to Amazon ECR...
- $(aws ecr get-login --region $AWS_DEFAULT_REGION --no-include-email)
代码构建正常工作,没有任何更改。只停止了工作。
阅读此GitHub问题#2596。我纠正了我的错误。
在PRE_BUILD部分之前,我将此行添加到了buildspec-cd.yml文件中:
pip install-升级awscli
install:
commands:
- pip3 install awsebcli --upgrade
- eb --version
- pip install --upgrade awscli
pre_build:
commands:
- AWS_REGION=${AWS_DEFAULT_REGION}
- COMMIT_HASH=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7)
- IMAGE_VERSION=${COMMIT_HASH}
...
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句