loca1h0st's Blog
loca1h0st's Blog

Common Issues with Installing pip Packages on Python3 Alpine Linux

Common Issues with Installing pip Packages on Python3 Alpine Linux
“`html
  • 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


For instance, here’s a sample Dockerfile for a Python project after it’s been completed:

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"]

Information about the Python project:

“`
# # #
Homepage      Docker      Common Issues with Installing pip Packages on Python3 Alpine Linux

Leave a Reply

textsms
account_circle
email

loca1h0st's Blog

Common Issues with Installing pip Packages on Python3 Alpine Linux
```html 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 …
Scan QR code to continue reading
2021-11-29