ImportError: cannot import name 'docevents' from 'botocore.docs.bcdoc' in AWS CodeBuild

Reading this GitHub issue #2596. i fixed my error.

Just before the PRE_BUILD section, I added this line to my buildspec-cd.yml file:

pip3 install --upgrade awscli

install:
    commands:
      - pip3 install awsebcli --upgrade
      - eb --version
      - pip3 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}
      ...