如何在高山linux上安装python? [英] How do I install python on alpine linux?

查看:100
本文介绍了如何在高山linux上安装python?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在基于高山的映像上安装python3和python3-pip(不使用python映像)?

How do I install python3 and python3-pip on an alpine based image (without using a python image)?

 $ apk add --update python3.8 python3-pip
 ERROR: unsatisfiable constraints:
   python3-pip (missing):
     required by: world[python3-pip]
   python3.8 (missing):
     required by: world[python3.8]

推荐答案

这是我在Dockerfile中使用的用于高山映像的内容:

This is what I use in a Dockerfile for an alpine image:

# Install python/pip
ENV PYTHONUNBUFFERED=1
RUN apk add --update --no-cache python3 && ln -sf python3 /usr/bin/python
RUN python3 -m ensurepip
RUN pip3 install --no-cache --upgrade pip setuptools

这篇关于如何在高山linux上安装python?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆