coremltools icon indicating copy to clipboard operation
coremltools copied to clipboard

`scripts/test.sh` fails to install `h5py`

Open fumoboy007 opened this issue 3 years ago • 2 comments

🐞Describing the bug

scripts/test.sh fails to install h5py.

Stack Trace

Building wheel for h5py (setup.py) ... error
ERROR: Command errored out with exit status 1:
 command: /Users/fumoboy007/Downloads/coremltools/envs/coremltools-py3.9/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/nr/xplth_g12fn0dzv2_rjfx1j40000gn/T/pip-install-b0xjsu5k/h5py_b21a3b30d7d7452a85a54d4fa01a2acf/setup.py'"'"'; __file__='"'"'/private/var/folders/nr/xplth_g12fn0dzv2_rjfx1j40000gn/T/pip-install-b0xjsu5k/h5py_b21a3b30d7d7452a85a54d4fa01a2acf/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/nr/xplth_g12fn0dzv2_rjfx1j40000gn/T/pip-wheel-5yv448cc
     cwd: /private/var/folders/nr/xplth_g12fn0dzv2_rjfx1j40000gn/T/pip-install-b0xjsu5k/h5py_b21a3b30d7d7452a85a54d4fa01a2acf/
Complete output (66 lines):
/Users/fumoboy007/Downloads/coremltools/envs/coremltools-py3.9/lib/python3.9/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
  warnings.warn(
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.9
creating build/lib.macosx-10.9-x86_64-3.9/h5py
copying h5py/h5py_warnings.py -> build/lib.macosx-10.9-x86_64-3.9/h5py
copying h5py/version.py -> build/lib.macosx-10.9-x86_64-3.9/h5py
copying h5py/highlevel.py -> build/lib.macosx-10.9-x86_64-3.9/h5py
copying h5py/__init__.py -> build/lib.macosx-10.9-x86_64-3.9/h5py
copying h5py/ipy_completer.py -> build/lib.macosx-10.9-x86_64-3.9/h5py
creating build/lib.macosx-10.9-x86_64-3.9/h5py/_hl
copying h5py/_hl/files.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/_hl
copying h5py/_hl/compat.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/_hl
copying h5py/_hl/__init__.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/_hl
copying h5py/_hl/selections.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/_hl
copying h5py/_hl/dataset.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/_hl
copying h5py/_hl/vds.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/_hl
copying h5py/_hl/selections2.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/_hl
copying h5py/_hl/group.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/_hl
copying h5py/_hl/datatype.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/_hl
copying h5py/_hl/attrs.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/_hl
copying h5py/_hl/dims.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/_hl
copying h5py/_hl/base.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/_hl
copying h5py/_hl/filters.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/_hl
creating build/lib.macosx-10.9-x86_64-3.9/h5py/tests
copying h5py/tests/test_deprecation.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/tests
copying h5py/tests/test_dimension_scales.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/tests
copying h5py/tests/test_attribute_create.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/tests
copying h5py/tests/test_file_image.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/tests
copying h5py/tests/test_h5d_direct_chunk.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/tests
copying h5py/tests/test_h5f.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/tests
copying h5py/tests/test_dataset_getitem.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/tests
copying h5py/tests/test_group.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/tests
copying h5py/tests/test_dataset_swmr.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/tests
copying h5py/tests/test_slicing.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/tests
copying h5py/tests/test_h5pl.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/tests
copying h5py/tests/test_attrs.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/tests
copying h5py/tests/__init__.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/tests
copying h5py/tests/test_attrs_data.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/tests
copying h5py/tests/test_h5t.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/tests
copying h5py/tests/test_h5p.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/tests
copying h5py/tests/test_dims_dimensionproxy.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/tests
copying h5py/tests/test_datatype.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/tests
copying h5py/tests/common.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/tests
copying h5py/tests/test_dataset.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/tests
copying h5py/tests/test_file.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/tests
copying h5py/tests/test_selections.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/tests
copying h5py/tests/test_threads.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/tests
copying h5py/tests/test_dtype.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/tests
copying h5py/tests/test_h5.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/tests
copying h5py/tests/test_file2.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/tests
copying h5py/tests/test_completions.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/tests
copying h5py/tests/test_filters.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/tests
copying h5py/tests/test_base.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/tests
copying h5py/tests/test_objects.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/tests
creating build/lib.macosx-10.9-x86_64-3.9/h5py/tests/test_vds
copying h5py/tests/test_vds/test_highlevel_vds.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/tests/test_vds
copying h5py/tests/test_vds/test_virtual_source.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/tests/test_vds
copying h5py/tests/test_vds/__init__.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/tests/test_vds
copying h5py/tests/test_vds/test_lowlevel_vds.py -> build/lib.macosx-10.9-x86_64-3.9/h5py/tests/test_vds
running build_ext
Loading library to get version: libhdf5.dylib
error: dlopen(libhdf5.dylib, 0x0006): tried: '/Users/fumoboy007/Downloads/coremltools/envs/coremltools-py3.9/lib/libhdf5.dylib' (no such file), '/Users/fumoboy007/Downloads/coremltools/envs/coremltools-py3.9/lib/libhdf5.dylib' (no such file), '/Users/fumoboy007/Downloads/coremltools/envs/coremltools-py3.9/lib/python3.9/lib-dynload/../../libhdf5.dylib' (no such file), '/Users/fumoboy007/Downloads/coremltools/envs/coremltools-py3.9/lib/libhdf5.dylib' (no such file), '/Users/fumoboy007/Downloads/coremltools/envs/coremltools-py3.9/bin/../lib/libhdf5.dylib' (no such file), 'libhdf5.dylib' (no such file), '/usr/local/lib/libhdf5.dylib' (no such file), '/usr/lib/libhdf5.dylib' (no such file), '/private/var/folders/nr/xplth_g12fn0dzv2_rjfx1j40000gn/T/pip-install-b0xjsu5k/h5py_b21a3b30d7d7452a85a54d4fa01a2acf/libhdf5.dylib' (no such file)
----------------------------------------
ERROR: Failed building wheel for h5py

To Reproduce

Run the following commands:

git clean -xfd
scripts/build.sh --python=3.9
scripts/test.sh --python=3.9

System environment (please complete the following information):

  • coremltools version: HEAD (AKA 161898d5b7c36ba8b9d3df2f1bf84d07263b5710)
  • OS (e.g. MacOS version or Linux type): macOS 12.4
  • Any other relevant version information (e.g. PyTorch or TensorFlow version): Intel-based Mac

Additional context

This was after fixing #1532.

Note that this issue does not occur on a Mac with Apple silicon because test.pip excludes h5py from ARM64 builds.

fumoboy007 avatar Jun 16 '22 06:06 fumoboy007

Several of the versions pinned in our test.pip are not going to work with Python 3.9. This is because these versions are set to work with the last versions of scikit-learn and xgboost that we support. The last version of scikit-learn that we support does not support Python 3.9.

Ideally, we would update the versions of scikit-learn and xgboost that we support. However that is a major project. A shorter term solution would be to create a new test.pip each testing package we use support.

Until we come up with a solution to this issue, please use Python 3.7 for testing. That is the main version we use for testing.

TobyRoseman avatar Jun 16 '22 23:06 TobyRoseman

Hmm OK. I guess that means no tests on Apple silicon for now?

fumoboy007 avatar Jun 17 '22 06:06 fumoboy007