Paddle 在mac m2下的docker python无法安装

icnyk63a  于 2个月前  发布在  Mac
关注(0)|答案(8)|浏览(49)

问题描述 Issue Description

在docker这里arm64/aarch64应该是同一个东西吧?

这是docker内环境

python3 -c "import platform;print(platform.architecture()[0]);print(platform.machine())"

64bit
aarch64

这是报错

python -m pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple

Looking in indexes: https://mirror.baidu.com/pypi/simple
ERROR: Could not find a version that satisfies the requirement paddlepaddle (from versions: none)
ERROR: No matching distribution found for paddlepaddle

版本&环境信息 Version & Environment Information

macos m2 docker

siv3szwd

siv3szwd2#

可以直接使用mac的环境安装飞桨

kzmpq1sx

kzmpq1sx3#

如果要使用docker环境的话,可以先临时使用由用户自行编译的arm架构的安装包,只有python3.8版本,安装命令如下:
python3.8 -m pip install https://paddle-qa.bj.bcebos.com/CompileService/train/aarch64/paddlepaddle-2.3.2-cp38-cp38-linux_aarch64.whl

vfhzx4xs

vfhzx4xs4#

Legend,
@XieYunshen
was stuck in a problem while building the container in m2
got it solved ✅
I feel paddle team can release a docker file like this, so its easier for others who faced similar problems

FROM ubuntu:20.04

LABEL maintainer=ajay.ghiyad@interns.salt.pe

ENV TZ=Asia/Kolkata \
    DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y \
    python3.8 \
    python3-pip \

    libgl1-mesa-glx \
    libglib2.0-0

COPY layoutparser-0.0.0-py3-none-any.whl /app/

WORKDIR /app

COPY requirements.txt .

RUN pip install -r requirements.txt

RUN pip install layoutparser

RUN python3.8 -m pip install https://paddle-qa.bj.bcebos.com/CompileService/train/aarch64/paddlepaddle-2.3.2-cp38-cp38-linux_aarch64.whl
RUN python3.8 -m pip install layoutparser-0.0.0-py3-none-any.whl

RUN pip install "paddleocr>=2.0.1" --upgrade PyMuPDF==1.21.1

COPY . .

EXPOSE 8000

CMD [ "python3.8", "flask_app.py" ]

Once again Thanks
@XieYunshen gg ;)

rggaifut

rggaifut5#

@ajayghiyad tried running your above code received an error in this command RUN python3.8 -m pip install https://paddle-qa.bj.bcebos.com/CompileService/train/aarch64/p ...
i commented your this command "COPY layoutparser-0.0.0-py3-none-any.whl /app/"
error:
"failed to solve: executor failed running [/bin/sh -c python3.8 -m pip install https://paddle-qa.bj.bcebos.com/CompileService/train/aarch64/paddlepaddle-2.3.2-cp38-cp38-linux_aarch64.whl]: exit code: 2"
how did you tackle this error?

mnowg1ta

mnowg1ta6#

I am using Rosetta to emulate this over m2

ddrv8njm

ddrv8njm7#

thank you! yeah working for me as well

pdkcd3nj

pdkcd3nj8#

@ajayghiyad Can you share the requirements.txt file you used in the Dockerfile? Thanks!

相关问题