Legacy-install-failure while installing tensorflow in M1 Macbook Pro

I have been trying to install TensorFlow 2.6.0 in a conda environment. Here's the command:

python -m pip install tensorflow-macos==2.6.0

But it gives me this error:

        TypeError: str expected, not int
       [end of output]
     
     note: This error originates from a subprocess, and is likely not a problem with pip.
    error: legacy-install-failure
     
    × Encountered error while trying to install package.
    ╰─> numpy
     
    note: This is an issue with the package mentioned above, not pip.
    hint: See above for output from the failure.
     
    [notice] A new release of pip available: 22.1.2 -> 22.2.1
    [notice] To update, run: python3.8 -m pip install --upgrade pip
    [end of output]
  
 note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install backend dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

[notice] A new release of pip available: 22.1.2 -> 22.2.1
[notice] To update, run: python3.8 -m pip install --upgrade pip

The full output is too large to fit in here. So I put the output here - https://docs.google.com/document/d/1eKL5UbeK8y0nNbp3mnWPBUutrTOTiWHALjZliQtB7jw/edit?usp=sharing Go check it out.

Please help me to successfully install Tensorflow in my M1 MacBook Pro.

OS: macOS Big Sur v11.6; Environment python: Python 3.8.13; Environment pip: Pip v22.1.2

Hi @arannya!

You will need to move your OS to a version where the tensorflow-macos is supported i.e. 12.0+ but I do recommend to update directly to the newest available one. After that following the guide at https://developer.apple.com/metal/tensorflow-plugin/ should allow you to install tensorflow-macos. But there I would also advise to install the newest available version unless there is a strong reason not to since there have been updates to performance as well as bug fixes between the versions.

Legacy-install-failure while installing tensorflow in M1 Macbook Pro
 
 
Q