本文介绍了错误:serverlessrepo 0.1.8要求pyyaml〜= 3.12的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面是带有基本映像python 3.7的docker文件:

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.






如何安装 pyyaml 3.12 ? python 3.6或python 3.7基本映像


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

推荐答案

您需要安装 PyYAML == 3.12 为您的aws-sam-cli
,因为Docker映像默认带有 pyyaml 5.1 ,它与 aws兼容-sam-cli 。在安装 aws-sam-cli

You need to install PyYAML==3.12 for your aws-sam-clias 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

这篇关于错误:serverlessrepo 0.1.8要求pyyaml〜= 3.12的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 00:55