tensorflow-deps - PackagesNotFoundError
Asked Answered
C

3

9

I'm using my new M1 Pro with the latest Mac OS 12.1 and I'm experiencing issues with installing tensorflow.

I installed Miniforge3 using:

chmod +x ~/Downloads/Miniforge3-MacOSX-arm64.sh

sh ~/Downloads/Miniforge3-MacOSX-arm64.sh

source ~/miniforge3/bin/activate

I've created an environment and have it activated.

Then I tried

conda install -c apple tensorflow-deps

And here is what's returned:

Collecting package metadata (current_repodata.json): done

Solving environment: failed with initial frozen solve. Retrying with flexible solve.

Collecting package metadata (repodata.json): done

Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:
  - tensorflow-deps

Current channels:

  - https://conda.anaconda.org/apple/osx-64
  - https://conda.anaconda.org/apple/noarch
  - https://repo.anaconda.com/pkgs/main/osx-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/osx-64
  - https://repo.anaconda.com/pkgs/r/noarch

To search for alternate channels that may provide the conda package you`re
looking for, navigate to

https://anaconda.org

and use the search bar at the top of the page.

Note: you may need to restart the kernel to use updated packages.

conda info

    active env location : /Users/andrewli/tensorflow-test/env
            shell level : 2
       user config file : /Users/andrewli/.condarc
 populated config files : /Users/andrewli/.condarc
          conda version : 4.10.3
    conda-build version : 3.21.5
         python version : 3.9.7.final.0
       virtual packages : __osx=10.16=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /Users/andrewli/opt/anaconda3  (writable)
      conda av data dir : /Users/andrewli/opt/anaconda3/etc/conda
  conda av metadata url : None
           channel URLs : https://repo.anaconda.com/pkgs/main/osx-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/osx-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /Users/andrewli/opt/anaconda3/pkgs
                          /Users/andrewli/.conda/pkgs
       envs directories : /Users/andrewli/opt/anaconda3/envs
                          /Users/andrewli/.conda/envs
               platform : osx-64
             user-agent : conda/4.10.3 requests/2.26.0 CPython/3.9.7 Darwin/21.2.0 OSX/10.16
                UID:GID : 501:20
             netrc file : None
           offline mode : False

Did anyone have the same issue and any advice to address this?

Cracker answered 3/1, 2022 at 5:36 Comment(4)
Details show you are running Anaconda3 in emulation (x86_64) mode. Did you previously have Anaconda installed?Chavarria
@Chavarria yes I have anaconda installed. Should I remove Anaconda to install tensorflow (then install it back)? If so I guess I'll be running python 2.7.18 that comes with the Mac, which seems to be old and some basic stuff is missing (like pip)Cracker
It's a bit more complicated than that. What terminal are you running? Anaconda Prompt only supports Rosetta (x86_64 emulation); a Miniforge osx-arm64 should be run from the Mac Terminal running a native shell application (usually zsh).Chavarria
This might be relevant background reading: anaconda.com/blog/apple-silicon-transition.Chavarria
S
6

This video really helped: https://www.youtube.com/watch?v=BEUU-icPg78 ("TensorFlow: Mac M1/M2: Conda | tensorflow-deps - PackagesNotFoundError" from Jeff Heaton)

According to this video the problem most likely lies in the fact that you have installed anaconda or miniconda for x86 and not arm. You can test this in your conda base env in python via:

>>> import platform
>>> platform.platform()
'macOS-12.6.3-arm64-arm-64bit'

If the platform is not arm64, python is still running x86 code emulated via rosetta 2 and conda cannot find tensorflow-deps. To resolve the problem, you have to uninstall conda and install it again, but this time using the right version (arm, not x86). Hope this helped. More info about that can be found in the video.

Squander answered 23/2, 2023 at 15:53 Comment(0)
T
1

I had the same problem At first you should install miniforge like in this guide https://makeoptim.com/en/deep-learning/tensorflow-metal. At first, download it from GitHub. Then write "bash (full path to the file of Miniforge)" in the terminal. Then create virtual environment and write "conda install -c apple tensorflow-deps".

Talus answered 24/1, 2022 at 19:55 Comment(0)
C
0

I followed the instructions shown here

I faced the same problem, but finally I find I am wrong to install Miniforge3 uncompletely.I always stop in the step view below.At beginning, when I see this view,I think I have finish and close the terminal and start to do the next step.

enter image description here

Finally, I find I need to keep press enter button until the installation step complete. ,and then I can start to create env and to install tensorflow. The step is easy to follow. I am not sure if you have the same problem as me. for your reference.

Carolinacaroline answered 14/3, 2022 at 23:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.