Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

1.2K
Visualizações
Tensorflow not found on pip install inside Docker Container using Mac M1

I'm trying to run some projects using the new Mac M1. Those projects already work on Intel processor and are used by other developers that use Intel.

I am not able to build this simple Dockerfile:

FROM python:3.9

RUN python -m pip install --upgrade pip

RUN pip install tensorflow==2.6.2

I get this message:

 > [3/3] RUN pip install tensorflow==2.6.2:                                                                                                            
#6 0.583 ERROR: Could not find a version that satisfies the requirement tensorflow==2.6.2 (from versions: none)                                        
#6 0.583 ERROR: No matching distribution found for tensorflow==2.6.2  

I am able to install tensorflow locally, outside of the Dockerfile. Also, friends are able to build this image from their intel Mac.

I even tried to run docker build com different console architectures: i386 and arm64, but none work.

Any suggestions?

over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

EDIT: you may want to check menrfa's answer by looking at https://github.com/KumaTea/tensorflow-aarch64


The package tensorflow is not available for armv8.

I'll guessing your local python is running using rosetta2 (intel x86_64). You can check that using:

python3 -c "import platform; print(platform.machine())"
x86_64

The solution is forcing Docker to build that image for x86_64 also. It's easy. Just change your Dockerfile to:

FROM --platform=linux/x86_64 python:3.9

RUN python -m pip install --upgrade pip

RUN pip install tensorflow==2.6.2

Or, if you do not want to change your Dockerfile, you may build that image with:

docker build --platform linux/x86_64 -t myimage .

post note:

as [tyrex] said in a comment, although the tensorflow gets installed on the armv8, it will probably fail due to some bugs on the emulation (eg qemu: uncaught target signal 6 (Aborted) - core dumped).

He solved his requirements using PyTorch instead.

over 4 years ago · Santiago Trujillo Relatório

0

The following works for me. (Chip Apple M1 Pro + MacOS 12.1)

Docker: Debian GNU/Linux 11 (bullseye)

RUN pip install tensorflow==2.6.0 -f https://tf.kmtea.eu/whl/stable.html

Obviously thanks to https://github.com/KumaTea/tensorflow-aarch64

over 4 years ago · Santiago Trujillo Relatório

0

Tensorflow currently does not provide binaries (.whl files) for linux/arch64 inside docker containers on M1.

But you can use my prebuilt TensorFlow .whl file for M1: https://github.com/diyor28/tf-docker-m1

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda