Skip to content

"not a mach-o file" error when trying to import on M1 Mac #4852

Closed
@imadahmad97

Description

/!\ PLEASE INCLUDE THE FULL STACKTRACE AND CODE SNIPPET

Short description
I have set up a tensorflow-ready environment on my mac, but when I try to import tensorflow-datasets, I get the following output:


ImportError Traceback (most recent call last)
Cell In[1], line 1
----> 1 import tensorflow_datasets as tfds

File ~/tensorflow-ready/env/lib/python3.9/site-packages/tensorflow_datasets/init.py:43
41 _TIMESTAMP_IMPORT_STARTS = time.time()
42 from absl import logging
---> 43 import tensorflow_datasets.core.logging as _tfds_logging
44 from tensorflow_datasets.core.logging import call_metadata as _call_metadata
46 _metadata = _call_metadata.CallMetadata()

File ~/tensorflow-ready/env/lib/python3.9/site-packages/tensorflow_datasets/core/init.py:22
18 # Allow to use tfds.core.Path in dataset implementation which seems more
19 # natural than having to import a third party module.
20 from etils.epath import Path
---> 22 from tensorflow_datasets.core import community
23 from tensorflow_datasets.core.dataset_builder import BeamBasedBuilder
24 from tensorflow_datasets.core.dataset_builder import BuilderConfig

File ~/tensorflow-ready/env/lib/python3.9/site-packages/tensorflow_datasets/core/community/init.py:18
1 # coding=utf-8
2 # Copyright 2023 The TensorFlow Datasets Authors.
3 #
(...)
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 """Community dataset API."""
---> 18 from tensorflow_datasets.core.community.huggingface_wrapper import mock_builtin_to_use_gfile
19 from tensorflow_datasets.core.community.huggingface_wrapper import mock_huggingface_import
20 from tensorflow_datasets.core.community.load import builder_cls_from_module

File ~/tensorflow-ready/env/lib/python3.9/site-packages/tensorflow_datasets/core/community/huggingface_wrapper.py:31
28 from unittest import mock
30 from etils import epath
---> 31 from tensorflow_datasets.core import dataset_builder
32 from tensorflow_datasets.core import dataset_info
33 from tensorflow_datasets.core import download

File ~/tensorflow-ready/env/lib/python3.9/site-packages/tensorflow_datasets/core/dataset_builder.py:34
32 from etils import epath
33 from tensorflow_datasets.core import constants
---> 34 from tensorflow_datasets.core import dataset_info
35 from tensorflow_datasets.core import dataset_metadata
36 from tensorflow_datasets.core import decode

File ~/tensorflow-ready/env/lib/python3.9/site-packages/tensorflow_datasets/core/dataset_info.py:47
45 from etils import epath
46 from tensorflow_datasets.core import constants
---> 47 from tensorflow_datasets.core import file_adapters
48 from tensorflow_datasets.core import lazy_imports_lib
49 from tensorflow_datasets.core import naming

File ~/tensorflow-ready/env/lib/python3.9/site-packages/tensorflow_datasets/core/file_adapters.py:29
26 from tensorflow_datasets.core.utils import type_utils
27 from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow as tf
---> 29 from array_record.python import array_record_module
31 ExamplePositions = List[Any]
34 class FileFormat(enum.Enum):

ImportError: dlopen(/Users/imadahmad/tensorflow-ready/env/lib/python3.9/site-packages/array_record/python/array_record_module.so, 0x0002): tried: '/Users/imadahmad/tensorflow-ready/env/lib/python3.9/site-packages/array_record/python/array_record_module.so' (not a mach-o file), '/System/Volumes/Preboot/Cryptexes/OS/Users/imadahmad/tensorflow-ready/env/lib/python3.9/site-packages/array_record/python/array_record_module.so' (no such file), '/Users/imadahmad/tensorflow-ready/env/lib/python3.9/site-packages/array_record/python/array_record_module.so' (not a mach-o file)

Environment information

  • Operating System:
  • Python version: <3.9>

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions