user16478428
user16478428

Reputation:

'Expected in: /usr/lib/libc++.1.dylib': Installing Tensorflow on M1 MacBook Pro

I am trying to install Tensorflow on my MacBook Pro with the M1 chip. The operating system of my MacBook is MacOS Big Sur Version 11.0.

enter image description here

In order to install Tensorflow to use it with Python, I have followed this tutorial, which says that I have to do the following:

  1. Install Homebrew.

  2. Download MiniForge3 for macOS arm64 chips (link provided in the webpage).

  3. Install MiniForge3 using:

    chmod +x ~/Downloads/Miniforge3-MacOSX-arm64.sh
    sh ~/Downloads/Miniforge3-MacOSX-arm64.sh
    source ~/miniforge3/bin/activate
    
  4. Create a folder to set up an environment for Tensorflow.

    mkdir tensorflow-test
    cd tensorflow-test
    
  5. Make and activate Conda environment.

    conda create --prefix ./env python=3.9.7
    conda activate ./env
    
  6. Install Tensorflow dependencies.

    conda install -c apple tensorflow-deps
    python -m pip install tensorflow-macos
    python -m pip install tensorflow-metal
    

After this, I open a Jupyter Notebook and I try to import tensorflow, but this error shows up:

OSError: dlopen(/Users/blancoarnau/tensorflow-test/env/lib/python3.9/site-packages/tensorflow/python/platform/../../core/platform/_cpu_feature_guard.so, 6): Symbol not found: __ZNKSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE3strEv
   Referenced from: /Users/blancoarnau/tensorflow-test/env/lib/python3.9/site-packages/tensorflow/python/platform/../../core/platform/_cpu_feature_guard.so (which was built for Mac OS X 12.3)
   Expected in: /usr/lib/libc++.1.dylib

As you can see in this screenshot:

enter image description here

Do you have an idea why this is happening?

Upvotes: 5

Views: 9064

Answers (1)

Yahro
Yahro

Reputation: 111

check the message details: (which was built for Mac OS X 12.3)

you need to upgrade macOS to 12.3

Upvotes: 6

Related Questions