首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >arm32v7/python安装numpy

arm32v7/python安装numpy
EN

Stack Overflow用户
提问于 2021-02-26 01:22:31
回答 1查看 205关注 0票数 2

我一直在尝试为一台旧的树莓派2B在Docker镜像中安装numpypandasscipy。当pip尝试安装它们时,问题就来了,它花费了太多的时间(甚至失败)。我一直使用的Dockerfile是:

代码语言:javascript
复制
FROM arm32v7/python:3.7-slim-buster

# Keeps Python from generating .pyc files in the container
ENV PYTHONDONTWRITEBYTECODE=1

# Turns off buffering for easier container logging
ENV PYTHONUNBUFFERED=1

# Install pip requirements
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Workdir
WORKDIR /book

# Switching to a non-root user
RUN useradd appuser && chown -R appuser /book
USER appuser

# During debugging, this entry point will be overridden.
CMD [ "jupyter", "notebook", "--no-mathjax", "--no-browser", "--port", "4000"]

我试着安装了一些库,比如build-essentialsgcc等等。但它并没有起作用。在操作系统(Raspberry Pi OS Lite)中安装这些包是相当快的,因为pip使用了armhf包。我尝试过的另一个选择是使用raspbian/stretch,但它是随Python3.5一起提供的,而scipy需要Python => 3.7。安装Python的主要版本会使容器太大(或多或少1 1GB)……

那么,有没有办法解决pip安装问题呢?

非常感谢!

更新:

问题是pip没有在:https://piwheels.org/simple中搜索已经编译过的包版本。因此,解决方案只需添加:

代码语言:javascript
复制
RUN pip install --index-url=https://www.piwheels.org/simple --no-cache-dir -r requirements.txt
EN

回答 1

Stack Overflow用户

发布于 2021-06-09 03:04:04

问题是pip没有在:https://piwheels.org/simple中搜索已经编译过的包版本。因此,解决方案只需添加:

代码语言:javascript
复制
RUN pip install --index-url=https://www.piwheels.org/simple --no-cache-dir -r requirements.txt
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66373417

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档