简体   繁体   English

无法在 numpy 的 docker 上安装轮子

[英]Can't install wheels on docker for numpy

this is my first time running Docker and I am having issues creating the image.这是我第一次运行 Docker 并且我在创建图像时遇到问题。 This is the code inside my docker file这是我的 docker 文件中的代码

FROM alpine:latest

ENV PATH /usr/local/bin:$PATH

RUN apk add --no-cache python3 py3-pip
RUN apk add py3-pip && pip3 install --upgrade pip

WORKDIR /backend

COPY . /backend

RUN pip3 install wheel
RUN pip3 install numpy
RUN pip3 --no-cache-dir install -r requirements.txt

Under requirements.txt , I have numpy==1.23.1 .requirements.txt下,我有numpy==1.23.1

The relevant error codes are相关的错误代码是

#12 8.606   Building wheel for numpy (pyproject.toml): started
#12 22.30   Building wheel for numpy (pyproject.toml): finished with status 'error'

#12 22.34 ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
------
executor failed running [/bin/sh -c pip3 install numpy]: exit code: 1

I tried searching for solutions but they mentioned that once you upgraded PIP, things should install fine.我尝试寻找解决方案,但他们提到升级 PIP 后,应该可以正常安装。 In this case, they still do not work well.在这种情况下,它们仍然不能很好地工作。

Do give any advice!请给任何建议!

Try pip3 install --extra-index-url https://alpine-wheels.github.io/index numpy isntead.试试 pip3 install --extra-index-url https://alpine-wheels.github.io/index numpy 是无效的。 Does that work?那样有用吗? If so, I can explain in an answer如果是这样,我可以在答案中解释

The above comment by FlyingTeller provided a solution for the problem. FlyingTeller 的上述评论为该问题提供了解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM