gpt4 book ai didi

python - 错误:serverlessrepo 0.1.8要求pyyaml〜= 3.12

转载 作者:行者123 更新时间:2023-12-02 21:07:10 24 4
gpt4 key购买 nike

以下是带有基本镜像python 3.7的docker文件:

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

给出错误:
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基本镜像

最佳答案

您需要为aws-sam-cli安装PyYAML==3.12当您的Docker镜像默认情况下带有pyyaml 5.1时,它与aws-sam-cli有兼容性问题。您需要先安装pyyaml 3.12,然后再安装aws-sam-cli

RUN pip install PyYAML==3.12
USER someteam
WORKDIR $HOME
RUN pip install --user --upgrade awscli aws-sam-cli;
USER root

关于python - 错误:serverlessrepo 0.1.8要求pyyaml〜= 3.12,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57242577/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com