Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

439
Views
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 answers
Answer question

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 Report

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!