Not able to install tensor flow-macos

I am not able to install tensorflow-macos on m1 pro chip in my MacBook Pro then I'm receiving the following error.

ERROR: Command errored out with exit status 1:

   command: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /var/folders/fg/40zrph395xn9sq1pb875yl1c0000gn/T/tmp1ez2y04x

       cwd: /private/var/folders/fg/40zrph395xn9sq1pb875yl1c0000gn/T/pip-install-2no1wvp7/h5py_24b1d2fea4f04231ba3b77aadb15af98

  Complete output (70 lines):

  running bdist_wheel

  running build

  running build_py

  creating build

  creating build/lib.macosx-10.9-universal2-3.9

  creating build/lib.macosx-10.9-universal2-3.9/h5py

  copying h5py/h5py_warnings.py -> build/lib.macosx-10.9-universal2-3.9/h5py

  copying h5py/version.py -> build/lib.macosx-10.9-universal2-3.9/h5py

  copying h5py/init.py -> build/lib.macosx-10.9-universal2-3.9/h5py

  copying h5py/ipy_completer.py -> build/lib.macosx-10.9-universal2-3.9/h5py

  creating build/lib.macosx-10.9-universal2-3.9/h5py/_hl

  copying h5py/_hl/files.py -> build/lib.macosx-10.9-universal2-3.9/h5py/_hl

  copying h5py/_hl/compat.py -> build/lib.macosx-10.9-universal2-3.9/h5py/_hl

  copying h5py/_hl/init.py -> build/lib.macosx-10.9-universal2-3.9/h5py/_hl

  copying h5py/_hl/selections.py -> build/lib.macosx-10.9-universal2-3.9/h5py/_hl

  copying h5py/_hl/dataset.py -> build/lib.macosx-10.9-universal2-3.9/h5py/_hl

  copying h5py/_hl/vds.py -> build/lib.macosx-10.9-universal2-3.9/h5py/_hl

  copying h5py/_hl/selections2.py -> build/lib.macosx-10.9-universal2-3.9/h5py/_hl

  copying h5py/_hl/group.py -> build/lib.macosx-10.9-universal2-3.9/h5py/_hl

  copying h5py/_hl/datatype.py -> build/lib.macosx-10.9-universal2-3.9/h5py/_hl

  copying h5py/_hl/attrs.py -> build/lib.macosx-10.9-universal2-3.9/h5py/_hl

  copying h5py/_hl/dims.py -> build/lib.macosx-10.9-universal2-3.9/h5py/_hl

  copying h5py/_hl/base.py -> build/lib.macosx-10.9-universal2-3.9/h5py/_hl

  copying h5py/_hl/filters.py -> build/lib.macosx-10.9-universal2-3.9/h5py/_hl

  creating build/lib.macosx-10.9-universal2-3.9/h5py/tests

  copying h5py/tests/test_dimension_scales.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests

  copying h5py/tests/test_attribute_create.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests

  copying h5py/tests/test_file_image.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests

  copying h5py/tests/conftest.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests

  copying h5py/tests/test_h5d_direct_chunk.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests

  copying h5py/tests/test_h5f.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests

  copying h5py/tests/test_dataset_getitem.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests

  copying h5py/tests/test_group.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests

  copying h5py/tests/test_errors.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests

  copying h5py/tests/test_dataset_swmr.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests

  copying h5py/tests/test_slicing.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests

  copying h5py/tests/test_h5pl.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests

  copying h5py/tests/test_attrs.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests

  copying h5py/tests/init.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests

  copying h5py/tests/test_attrs_data.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests

  copying h5py/tests/test_h5t.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests

  copying h5py/tests/test_big_endian_file.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests

  copying h5py/tests/test_h5p.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests

  copying h5py/tests/test_dims_dimensionproxy.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests

  copying h5py/tests/test_h5o.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests

  copying h5py/tests/test_datatype.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests

  copying h5py/tests/common.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests

  copying h5py/tests/test_dataset.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests

  copying h5py/tests/test_file.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests

  copying h5py/tests/test_selections.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests

  copying h5py/tests/test_dtype.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests

  copying h5py/tests/test_h5.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests

  copying h5py/tests/test_file2.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests

  copying h5py/tests/test_completions.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests

  copying h5py/tests/test_filters.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests

  copying h5py/tests/test_base.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests

  copying h5py/tests/test_objects.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests

  creating build/lib.macosx-10.9-universal2-3.9/h5py/tests/data_files

  copying h5py/tests/data_files/init.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests/data_files

  creating build/lib.macosx-10.9-universal2-3.9/h5py/tests/test_vds

  copying h5py/tests/test_vds/test_highlevel_vds.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests/test_vds

  copying h5py/tests/test_vds/test_virtual_source.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests/test_vds

  copying h5py/tests/test_vds/init.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests/test_vds

  copying h5py/tests/test_vds/test_lowlevel_vds.py -> build/lib.macosx-10.9-universal2-3.9/h5py/tests/test_vds

  copying h5py/tests/data_files/vlen_string_s390x.h5 -> build/lib.macosx-10.9-universal2-3.9/h5py/tests/data_files

  copying h5py/tests/data_files/vlen_string_dset_utc.h5 -> build/lib.macosx-10.9-universal2-3.9/h5py/tests/data_files

  copying h5py/tests/data_files/vlen_string_dset.h5 -> build/lib.macosx-10.9-universal2-3.9/h5py/tests/data_files

  running build_ext

  Building h5py requires pkg-config unless the HDF5 path is explicitly specified

  error: pkg-config probably not installed: FileNotFoundError(2, 'No such file or directory')

  ----------------------------------------

  ERROR: Failed building wheel for h5py

Failed to build h5py

ERROR: Could not build wheels for h5py, which is required to install pyproject.toml-based projects

how did you install it ?

Hi  Ironlegend,

Looks like you are using system's Python. Please make sure you to follow arm64 : Apple Silicon setup instructions and OS requirements. Once you install Miniforge env run:

source ~/miniforge3/bin/activate
conda install -c apple tensorflow-deps
python -m pip install tensorflow-macos
python -m pip install tensorflow-metal

After installing hdf5 with homebrew, I needed to set the two env vars before pip3 install h5py:

export HDF5_DIR="/opt/homebrew/Cellar/hdf5/1.13.0/"
export CPATH="/opt/homebrew/include/"

where 1.13.0 is the version of hdf5 installed.

The homebrew based method above did not work for me. I still get the blasted ERROR: "Could not build wheels for h5py, which is required to install pyproject.toml-based projects"

I really don't want to install anaconda

I have installed it successfully using the instructions from here.

https://github.com/jeffheaton/t81_558_deep_learning/blob/master/install/tensorflow-install-mac-metal-jul-2021.ipynb

It uses miniforge which is lightweight compared to the full Anaconda. I too do not like to have multiple package managers floating around but nothing else was working and it is

I did eventually get everything to compile correctly but my TensorFlow would never run. It always ended with an error "INTERNAL: platform is already registered with name: "METAL". I could not get this to work with my homebred'ed Python3.9.10 but it works flawlessly with Python3.9.10 from miniforge.

Not able to install tensor flow-macos
 
 
Q