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

372
Views
Generic requirements.txt for TensorFlow on both Apple M1 and other devices

I have a new MacBook with the Apple M1 chipset. To install tensorflow, I follow the instructions here, i.e., installing tensorflow-metal and tensorflow-macos instead of the normal tensorflow package.

While this works fine, it means that I can't run the typical pip install -r requirements.txt as long as we have tensorflow in the requirements.txt. If we instead include tensorflow-macos, it'll lead to problems for non-M1 or even non-macOS users.

Our library must work on all platforms. Is there a generic install command that installs the correct TensorFlow version depending on whether the computer is a M1 Mac or not? So that we can use a single requirements.txt for everyone?

Or if that's not possible, can we pass some flag/option, e.g., pip install -r requirements.txt --m1 to install some variation? What's the simplest and most elegant solution here?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

According to this post Is there a way to have a conditional requirements.txt file for my Python application based on platform?

You can use conditionals on your requirements.txt, thus

tensorflow==2.8.0; sys_platform != 'darwin'
tensorflow-macos==2.8.0; sys_platform == 'darwin'
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!