ERROR: serverlessrepo 0.1.8 has requirement pyyaml

2019-08-16 13:42发布

Below is the docker file with base image python 3.7:

FROM python:3.7-alpine3.9


ENV HOME /home/someteam
ENV PATH $HOME/.local/bin:$PATH
RUN ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime
RUN apk add --no-cache --virtual .build-deps python2-dev  python3-dev gcc linux-headers musl-dev && \
    addgroup someteam --gid=5566; \
    adduser -G someteam -Du 5566 -h /home/someteam -s /bin/bash someteam; \
    chown -R someteam $HOME;
RUN apk add --no-cache groff less bash jq curl py-pip tzdata
USER someteam

WORKDIR $HOME

RUN pip install --user --upgrade awscli aws-sam-cli;
USER root

RUN apk del .build-deps; \
    rm -rf /var/cache/apk/*

USER someteam
WORKDIR $HOME

ADD somescript.sh $HOME/somescript.sh

gives error:

ERROR: serverlessrepo 0.1.8 has requirement pyyaml~=3.12, but you'll have pyyaml 5.1 which is incompatible.
ERROR: aws-sam-cli 0.18.0 has requirement PyYAML~=3.12, but you'll have pyyaml 5.1 which is incompatible.

How to install pyyaml 3.12? with python 3.6 or python 3.7 base image

2条回答
小情绪 Triste *
2楼-- · 2019-08-16 14:26

after this pull request is released, serverlessrepo should be on 5.1. According to the PR, SAM CLI will be upgraded to 5.1 soon.

查看更多
\"骚年 ilove
3楼-- · 2019-08-16 14:40

You need to install PyYAML==3.12 for your aws-sam-cli as you Docker image come with pyyaml 5.1 by default which have compatibility issue with aws-sam-cli. All you need to install pyyaml 3.12 before installation of aws-sam-cli

RUN pip install PyYAML==3.12
USER someteam
WORKDIR $HOME
RUN pip install --user --upgrade awscli aws-sam-cli;
USER root
查看更多
登录 后发表回答