loca1h0st's Blog
loca1h0st's Blog

Python3 Alpine Linux pip包安装常见问题

Python3 Alpine Linux pip包安装常见问题
  • limits.h: No such file or directory

apk add gcc g++

  • ffi.h: No such file or directory

apk add libffi-dev

  • ERROR: The ‘make’ utility is missing from PATH

apk add make

  • This package requires Rust >=1.41.0.

apk add rust

  • error: [Errno 2] No such file or directory: ‘cargo’

apk add cargo

  • openssl/opensslv.h: No such file or directory

apk add openssl-dev


以某个python项目为例,Dockerfile编写完成后的样例文件:

FROM python:3.8.6-alpine3.12
MAINTAINER loca1h0st<chenjh.network@gmail.com>
ENV TIMEZONE Asia/Shanghai

COPY . /var/www
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
    apk update && apk add gcc g++ make libffi-dev rust cargo openssl-dev && \
    echo ${TIMEZONE} > /etc/timezone && \
    pip install -r /var/www/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

RUN ["/bin/sh", "-c", "python /var/www/run.py"]

Python项目信息:

没有标签
首页      Docker      Python3 Alpine Linux pip包安装常见问题

发表回复

textsms
account_circle
email

loca1h0st's Blog

Python3 Alpine Linux pip包安装常见问题
limits.h: No such file or directory apk add gcc g++ ffi.h: No such file or directory apk add libffi-dev ERROR: The 'make' utility is missing from PATH apk add …
扫描二维码继续阅读
2021-11-29