Can't install tensorflow-io on m1
Asked Answered
N

3

11

I cant able to install tensorflow-io on m1 mac under Environment. Though i Succeeded in installing tensorflow-macos and other libraries but Getting error in tensorflow_io

"ERROR: Could not find a version that satisfies the requirement tensorflow-io (from versions: none)

ERROR: No matching distribution found for tensorflow-io"

Machine: M1 Mac

OS: MacOS Monterey 12.0.1

Env: Miniforge

Python: 3.9

Tensorflow version: 2.5.0

Nourishing answered 8/12, 2021 at 15:41 Comment(0)
D
7

You can install tensorflow-io with a wheel file.

First, clone the tensorflow/io repository and build it as shown below.

$ python3 setup.py -q bdist_wheel

The wheel file will be created in the dist directory. You can then install the wheel by doing the following.

$ python3 -m pip install --no-deps <wheel-file-build-from-last-step>

For your reference, the results of running it in my environment are as follows.

$ git clone https://github.com/tensorflow/io.git
$ cd io
$ python3 setup.py -q bdist_wheel
Project: tensorflow-io
Exclude: ['tests', 'tests.*', 'tensorflow_io_gcs_filesystem', 
'tensorflow_io_gcs_filesystem.*']
Install Requires: ['tensorflow-io-gcs-filesystem==0.24.0']
Project Rootpath: tensorflow_io
$ python3 -m pip install --no-deps dist/tensorflow_io-0.24.0-cp39-cp39-macosx_11_0_arm64.whl
Processing ./dist/tensorflow_io-0.24.0-cp39-cp39-macosx_11_0_arm64.whl
Installing collected packages: tensorflow-io
Successfully installed tensorflow-io-0.24.0

because version offen updates,remember check dist/ and replace file name, for example: tensorflow_io-0.27.0-cp310-cp310-macosx_12_0_arm64.whl

Reference URL: arm64 support for M1

Durkin answered 18/1, 2022 at 13:29 Comment(4)
On an M1 air I get: ERROR: tensorflow_io-0.24.0-cp38-cp38-macosx_10_14_arm64.whl is not a supported wheel on this platform.Sovereignty
I get this error: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn(Phytohormone
@Phytohormone I just spent 4 hours "debugging" the same problem until i realised: that's not a failure, it's just a warning. If you check the dist/ folder, you'll probably see that the wheel was built successfully.Tenner
Installation completes without errors, and I can import. But when trying to load an audio file with tfio.auido.AudioIOTensor(fname) I get a NotImplementedError: unable to open file: libtensorflow_io.so error. Has anyone had better luck?Mouth
B
3

Clone the tensorflow io GitHub repo

git clone https://github.com/tensorflow/io.git
cd io

Then cd into dst and list the files

python3 setup.py -q bdist_wheel
python3 setup.py -q bdist_wheel --project tensorflow_io_gcs_filesystem
ls dist

It should output a file with a name like these

tensorflow_io-0.31.0-cp39-cp39-macosx_11_0_arm64.whl
tensorflow_io_gcs_filesystem-0.31.0-cp39-cp39-macosx_11_0_arm64.whl

You can then install this wheel file:

pip install wheel
python3 -m pip install --no-deps dist/tensorflow_io-0.31.0-cp39-cp39-macosx_11_0_arm64.whl
python3 -m pip install --no-deps dist/tensorflow_io_gcs_filesystem-0.31.0-cp39-cp39-macosx_11_0_arm64.whl

Make sure you change the .whl files to your specific version

Beehive answered 16/3, 2023 at 11:11 Comment(0)
G
3

If other answers fail, try this

git clone https://github.com/tensorflow/io
cd io
python setup.py build
python setup.py install
Gaultiero answered 18/4, 2023 at 2:9 Comment(1)
worked for me. Macbook pro m1Pharr

© 2022 - 2024 — McMap. All rights reserved.