AllenInstitute / AllenSDK

code for reading and processing Allen Institute for Brain Science data
https://allensdk.readthedocs.io/en/latest/
Other
340 stars 150 forks source link

pip install allensdk on M1 Mac fails #2503

Closed FBen3 closed 2 years ago

FBen3 commented 2 years ago

Describe the bug

I tried following the Accessing Visual Behavior Ophys Data from the official guide. I created a new virtual environment with the latest version of pip 22.1.2 and Python3.10, then did pip install allensdk. First I run into issues described in Issue #426. Then it fails requiring numpy but after those are resolved it fails again giving a long error message.

To Reproduce

python3 -m venv --upgrade-deps test_for_Allen
source test_for_Allen/bin/activate
pip install numpy
pip install allensdk

Expected behavior

clean pip install of allensdk

Actual Behavior

Error message is too long, I'm getting

There was an error creating your Issue: body is too long, body is too long (maximum is 65536 characters).

Here are parts:

Collecting allensdk
  Using cached allensdk-2.13.4-py3-none-any.whl (1.8 MB)
Collecting scikit-image<0.17.0,>=0.14.0
  Using cached scikit-image-0.16.2.tar.gz (28.9 MB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: scikit-build<1.0.0 in ./test_for_Allen/lib/python3.10/site-packages (from allensdk) (0.15.0)
Requirement already satisfied: glymur==0.8.19 in ./test_for_Allen/lib/python3.10/site-packages (from allensdk) (0.8.19)
Requirement already satisfied: semver in ./test_for_Allen/lib/python3.10/site-packages (from allensdk) (2.13.0)
Requirement already satisfied: simpleitk<3.0.0,>=2.0.2 in ./test_for_Allen/lib/python3.10/site-packages (from allensdk) (2.1.1.2)
Requirement already satisfied: scipy<2.0.0,>=1.4.0 in ./test_for_Allen/lib/python3.10/site-packages (from allensdk) (1.8.1)
Collecting tables<3.7.0,>=3.6.0
  Using cached tables-3.6.1.tar.gz (4.6 MB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy in ./test_for_Allen/lib/python3.10/site-packages (from allensdk) (1.22.4)
Requirement already satisfied: setuptools in ./test_for_Allen/lib/python3.10/site-packages (from glymur==0.8.19->allensdk) (63.2.0)
Building wheels for collected packages: scikit-image, tables
  Building wheel for scikit-image (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [804 lines of output]
      /Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/lib/python3.10/site-packages/setuptools/config/setupcfg.py:463: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      /Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/lib/python3.10/site-packages/setuptools/config/setupcfg.py:463: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      Partial import of skimage during the build process.
      Cython >= 0.23.4 not found; falling back to pre-built /private/var/folders/6g/9c7g_2tx2sb7lp8ttwtfky640000gn/T/pip-install-rvfq0tqc/scikit-image_f7f73a95e678433bb155590b9dc1407f/skimage/_shared/geometry.c /private/var/folders/6g/9c7g_2tx2sb7lp8ttwtfky640000gn/T/pip-install-rvfq0tqc/scikit-image_f7f73a95e678433bb155590b9dc1407f/skimage/_shared/transform.c /private/var/folders/6g/9c7g_2tx2sb7lp8ttwtfky640000gn/T/pip-install-rvfq0tqc/scikit-image_f7f73a95e678433bb155590b9dc1407f/skimage/_shared/interpolation.c
      Cython >= 0.23.4 not found; falling back to pre-built /private/var/folders/6g/9c7g_2tx2sb7lp8ttwtfky640000gn/T/pip-install-rvfq0tqc/scikit-image_f7f73a95e678433bb155590b9dc1407f/skimage/draw/_draw.c
      ...
      /Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/lib/python3.10/site-packages/setuptools/config/setupcfg.py:463: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      running bdist_wheel
      running build
      running config_cc
      INFO: unifing config_cc, config, build_clib, build_ext, build commands --compiler options
      running config_fc
      INFO: unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
      running build_src
      INFO: build_src
      INFO: building extension "skimage._shared.geometry" sources
      ...
      /Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      ...
        warnings.warn(
      running build_py
      creating build
      creating build/lib.macosx-10.9-universal2-cpython-310
      creating build/lib.macosx-10.9-universal2-cpython-310/skimage
      copying skimage/conftest.py -> build/lib.macosx-10.9-universal2-cpython-310/skimage
      copying skimage/__init__.py -> build/lib.macosx-10.9-universal2-cpython-310/skimage
      copying skimage/_build.py -> build/lib.macosx-10.9-universal2-cpython-310/skimage
      copying skimage/setup.py -> build/lib.macosx-10.9-universal2-cpython-310/skimage
      ....
      INFO: customize UnixCCompiler
      INFO: customize UnixCCompiler using ConditionalOpenMP
      WARN: CCompilerOpt.__init__[969] : unable to detect CPU architecture which lead to disable the optimization. check dist_info:<<
      ('macosx-10.9-universal2', 'clang', '-Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -ftrapping-math')
      >>
      INFO: CCompilerOpt.cc_test_flags[1029] : testing flags (-march=native)
      INFO: C compiler: clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -ftrapping-math

      creating /var/folders/6g/9c7g_2tx2sb7lp8ttwtfky640000gn/T/tmpqie437y3/Users
      creating /var/folders/6g/9c7g_2tx2sb7lp8ttwtfky640000gn/T/tmpqie437y3/Users/benjaminfockter
      creating /var/folders/6g/9c7g_2tx2sb7lp8ttwtfky640000gn/T/tmpqie437y3/Users/benjaminfockter/Developer
      creating /var/folders/6g/9c7g_2tx2sb7lp8ttwtfky640000gn/T/tmpqie437y3/Users/benjaminfockter/Developer/Python
      creating /var/folders/6g/9c7g_2tx2sb7lp8ttwtfky640000gn/T/tmpqie437y3/Users/benjaminfockter/Developer/Python/virtual_envs
      creating
      ...       
      INFO: compile options: '-I/Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c'
      extra options: '-march=native'
      WARN: CCompilerOpt.dist_test[598] : CCompilerOpt._dist_test_spawn[732] : Command (clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -ftrapping-math -I/Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c /Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/lib/python3.10/site-packages/numpy/distutils/checks/test_flags.c -o /var/folders/6g/9c7g_2tx2sb7lp8ttwtfky640000gn/T/tmpqie437y3/Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/lib/python3.10/site-packages/numpy/distutils/checks/test_flags.o -MMD -MF /var/folders/6g/9c7g_2tx2sb7lp8ttwtfky640000gn/T/tmpqie437y3/Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/lib/python3.10/site-packages/numpy/distutils/checks/test_flags.o.d -march=native) failed with exit status 1 output ->
      clang: error: the clang compiler does not support '-march=native'

      WARN: CCompilerOpt.cc_test_flags[1033] : testing failed
      INFO: CCompilerOpt.cc_test_flags[1029] : testing flags (-O3)
      INFO: C compiler: clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -ftrapping-math

      INFO: compile options: '-I/Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c'
      extra options: '-O3'
      INFO: CCompilerOpt.cc_test_flags[1029] : testing flags (-Werror=switch)
      INFO: C compiler: clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -ftrapping-math

      INFO: compile options: '-I/Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c'
      extra options: '-Werror=switch'
      INFO: CCompilerOpt.cc_test_flags[1029] : testing flags (-Werror)
      INFO: C compiler: clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -ftrapping-math

      INFO: compile options: '-I/Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c'
      extra options: '-Werror'
      WARN: CCompilerOpt.dist_test[598] : CCompilerOpt._dist_test_spawn[732] : Command (clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -ftrapping-math -I/Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c /Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/lib/python3.10/site-packages/numpy/distutils/checks/test_flags.c -o /var/folders/6g/9c7g_2tx2sb7lp8ttwtfky640000gn/T/tmpqie437y3/Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/lib/python3.10/site-packages/numpy/distutils/checks/test_flags.o -MMD -MF /var/folders/6g/9c7g_2tx2sb7lp8ttwtfky640000gn/T/tmpqie437y3/Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/lib/python3.10/site-packages/numpy/distutils/checks/test_flags.o.d -Werror) failed with exit status 1 output ->
      error: overriding currently unsupported use of floating point exceptions on this target [-Werror,-Wunsupported-floating-point-opt]
      1 error generated.

      WARN: CCompilerOpt.cc_test_flags[1033] : testing failed
      INFO: CCompilerOpt.__init__[1717] : check requested baseline
      INFO: CCompilerOpt.__init__[1726] : check requested dispatch-able features
      INFO: CCompilerOpt.__init__[1742] : initialize targets groups
      INFO: CCompilerOpt.__init__[1744] : parse target group simd_test
      INFO: CCompilerOpt._parse_target_tokens[1955] : skip targets (XOP VSX3 VSX FMA4 VSX2 AVX512F SSE42 SSE2 NEON ASIMD (FMA3 AVX2) AVX512_SKX) not part of baseline or dispatch-able features
      INFO: CCompilerOpt.generate_dispatch_header[2288] : generate CPU dispatch header: (build/src.macosx-10.9-universal2-3.10/numpy/distutils/include/npy_cpu_dispatch_config.h)
      WARN: CCompilerOpt.generate_dispatch_header[2297] : dispatch header dir build/src.macosx-10.9-universal2-3.10/numpy/distutils/include does not exist, creating it
      INFO: customize UnixCCompiler
      WARN: #### ['clang', '-Wno-unused-result', '-Wsign-compare', '-Wunreachable-code', '-fno-common', '-dynamic', '-DNDEBUG', '-g', '-fwrapv', '-O3', '-Wall', '-arch', 'arm64', '-arch', 'x86_64', '-g'] #######
      INFO: customize UnixCCompiler using ConditionalOpenMP
      INFO: C compiler: clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -ftrapping-math

      INFO: compile options: '-I/Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c'
      extra options: '-fopenmp'
      INFO: clang: test.c
      clang: error: unsupported option '-fopenmp'
      clang: error: unsupported option '-fopenmp'
      INFO: building 'skimage._shared.geometry' extension
      INFO: compiling C sources
      INFO: C compiler: clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -ftrapping-math

      creating build/temp.macosx-10.9-universal2-cpython-310/skimage
      creating build/temp.macosx-10.9-universal2-cpython-310/skimage/_shared
      INFO: compile options: '-I/Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/lib/python3.10/site-packages/numpy/core/include -Ibuild/src.macosx-10.9-universal2-3.10/numpy/distutils/include -I/Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c'
      INFO: clang: skimage/_shared/geometry.c
      warning: overriding currently unsupported use of floating point exceptions on this target [-Wunsupported-floating-point-opt]
      1 warning generated.
      INFO: clang -bundle -undefined dynamic_lookup -arch arm64 -arch x86_64 -g build/temp.macosx-10.9-universal2-cpython-310/skimage/_shared/geometry.o -o build/lib.macosx-10.9-universal2-cpython-310/skimage/_shared/geometry.cpython-310-darwin.so
      INFO: building 'skimage._shared.transform' extension
      INFO: compiling C sources
      INFO: C compiler: clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -ftrapping-math

      INFO: compile options: '-I/Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/lib/python3.10/site-packages/numpy/core/include -I/Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/lib/python3.10/site-packages/numpy/core/include -Ibuild/src.macosx-10.9-universal2-3.10/numpy/distutils/include -I/Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c'
      INFO: clang: skimage/_shared/transform.c
      warning: overriding currently unsupported use of floating point exceptions on this target [-Wunsupported-floating-point-opt]
      In file included from skimage/_shared/transform.c:611:
      In file included from /Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/lib/python3.10/site-packages/numpy/core/include/numpy/arrayobject.h:5:
      In file included from /Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/lib/python3.10/site-packages/numpy/core/include/numpy/ndarrayobject.h:12:
      In file included from /Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/lib/python3.10/site-packages/numpy/core/include/numpy/ndarraytypes.h:1960:
      /Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/lib/python3.10/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with "          "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
      #warning "Using deprecated NumPy API, disable it with " \
       ^
      skimage/_shared/transform.c:19231:5: error: expression is not assignable
          ++Py_REFCNT(o);
          ^ ~~~~~~~~~~~~
      skimage/_shared/transform.c:19233:5: error: expression is not assignable
          --Py_REFCNT(o);
          ^ ~~~~~~~~~~~~
      skimage/_shared/transform.c:19526:5: error: expression is not assignable
          ++Py_REFCNT(o);
          ^ ~~~~~~~~~~~~
      skimage/_shared/transform.c:19528:5: error: expression is not assignable
          --Py_REFCNT(o);
          ^ ~~~~~~~~~~~~
      skimage/_shared/transform.c:19768:5: error: expression is not assignable
          ++Py_REFCNT(o);
          ^ ~~~~~~~~~~~~
      skimage/_shared/transform.c:19770:5: error: expression is not assignable
          --Py_REFCNT(o);
          ^ ~~~~~~~~~~~~
      skimage/_shared/transform.c:21698:22: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                          (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                           ^
      /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:261:7: note: expanded from macro 'PyUnicode_GET_SIZE'
            PyUnicode_WSTR_LENGTH(op) :                    \
            ^
      /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:451:35: note: expanded from macro 'PyUnicode_WSTR_LENGTH'
      #define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject*)op)
                                        ^
      /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:445:1: note: '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
      Py_DEPRECATED(3.3)
      ^
      ...
      15 warnings and 6 errors generated.
      error: Command "clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -ftrapping-math -I/Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/lib/python3.10/site-packages/numpy/core/include -I/Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/lib/python3.10/site-packages/numpy/core/include -Ibuild/src.macosx-10.9-universal2-3.10/numpy/distutils/include -I/Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c skimage/_shared/transform.c -o build/temp.macosx-10.9-universal2-cpython-310/skimage/_shared/transform.o -MMD -MF build/temp.macosx-10.9-universal2-cpython-310/skimage/_shared/transform.o.d" failed with exit status 1
      INFO:
      ########### EXT COMPILER OPTIMIZATION ###########
      INFO: Platform      :
        Architecture: unsupported
        Compiler    : clang

      CPU baseline  :
        Requested   : optimization disabled
        Enabled     : none
        Flags       : none
        Extra checks: none
        Requested   : optimization disabled

      CPU dispatch  :
        Enabled     : none
        Generated   : none
      INFO: CCompilerOpt.cache_flush[825] : write cache to path -> /private/var/folders/6g/9c7g_2tx2sb7lp8ttwtfky640000gn/T/pip-install-rvfq0tqc/scikit-image_f7f73a95e678433bb155590b9dc1407f/build/temp.macosx-10.9-universal2-cpython-310/ccompiler_opt_cache_ext.py
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for scikit-image
  Running setup.py clean for scikit-image
  Building wheel for tables (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [1072 lines of output]
      cpuinfo failed, assuming no CPU features: py-cpuinfo currently only works on X86 and some PPC and ARM CPUs.
      * Using Python 3.10.3 (v3.10.3:a342a49189, Mar 16 2022, 09:34:18) [Clang 13.0.0 (clang-1300.0.29.30)]
      * USE_PKGCONFIG: False
      /private/var/folders/6g/9c7g_2tx2sb7lp8ttwtfky640000gn/T/pip-install-rvfq0tqc/tables_b7673fee560e45678dfd777f2ddc413a/setup.py:373: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
        return LooseVersion("%s.%s.%s" % (major_version, minor_version,
      * Found HDF5 headers at ``/opt/homebrew/opt/hdf5/include``, library at ``/opt/homebrew/opt/hdf5/lib``.
      .. WARNING:: Could not find the HDF5 runtime.
         The HDF5 shared library was *not* found in the default library
         paths. In case of runtime problems, please remember to install it.
      /var/folders/6g/9c7g_2tx2sb7lp8ttwtfky640000gn/T/lzo_version_dateawcciy9e.c:2:5: error: implicit declaration of function 'lzo_version_date' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
          lzo_version_date();
          ^
      1 error generated.
      * Could not find LZO 2 headers and library; disabling support for it.
      /var/folders/6g/9c7g_2tx2sb7lp8ttwtfky640000gn/T/lzo_version_datep7l0fh_q.c:2:5: error: implicit declaration of function 'lzo_version_date' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
          lzo_version_date();
          ^
      1 error generated.
      * Could not find LZO 1 headers and library; disabling support for it.
      /var/folders/6g/9c7g_2tx2sb7lp8ttwtfky640000gn/T/BZ2_bzlibVersionbbt62nvt.c:2:5: error: implicit declaration of function 'BZ2_bzlibVersion' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
          BZ2_bzlibVersion();
          ^
      1 error generated.
      * Could not find bzip2 headers and library; disabling support for it.
      * Found blosc headers at ``/opt/homebrew/opt/c-blosc/include``, library at ``/opt/homebrew/opt/c-blosc/lib``.
      .. WARNING:: Could not find the blosc runtime.
         The blosc shared library was *not* found in the default library
         paths. In case of runtime problems, please remember to install it.
      /Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/lib/python3.10/site-packages/setuptools/_distutils/dist.py:257: UserWarning: Unknown distribution option: 'extra_require'
        warnings.warn(msg)
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.macosx-10.9-universal2-cpython-310
      creating build/lib.macosx-10.9-universal2-cpython-310/tables
      copying tables/link.py -> build/lib.macosx-10.9-universal2-cpython-310/tables
      ...
      running build_ext
      building 'tables.utilsextension' extension
      creating build/temp.macosx-10.9-universal2-cpython-310
      creating build/temp.macosx-10.9-universal2-cpython-310/hdf5-blosc
      creating build/temp.macosx-10.9-universal2-cpython-310/hdf5-blosc/src
      creating build/temp.macosx-10.9-universal2-cpython-310/src
      creating build/temp.macosx-10.9-universal2-cpython-310/tables
      clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -DNDEBUG=1 -DHAVE_BLOSC_LIB=1 -Ihdf5-blosc/src -I/usr/local/include -I/sw/include -I/opt/include -I/opt/local/include -I/usr/include -I/include -I/opt/homebrew/opt/hdf5/include -I/opt/homebrew/opt/c-blosc/include -I/Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/lib/python3.10/site-packages/numpy/core/include -I/Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c hdf5-blosc/src/blosc_filter.c -o build/temp.macosx-10.9-universal2-cpython-310/hdf5-blosc/src/blosc_filter.o -Isrc -DH5_USE_18_API -DH5Acreate_vers=2 -DH5Aiterate_vers=2 -DH5Dcreate_vers=2 -DH5Dopen_vers=2 -DH5Eclear_vers=2 -DH5Eprint_vers=2 -DH5Epush_vers=2 -DH5Eset_auto_vers=2 -DH5Eget_auto_vers=2 -DH5Ewalk_vers=2 -DH5E_auto_t_vers=2 -DH5Gcreate_vers=2 -DH5Gopen_vers=2 -DH5Pget_filter_vers=2 -DH5Pget_filter_by_id_vers=2 -DH5Tarray_create_vers=2 -DH5Tget_array_dims_vers=2 -DH5Z_class_t_vers=2
      hdf5-blosc/src/blosc_filter.c:182:18: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
              complist = blosc_list_compressors();
                       ^ ~~~~~~~~~~~~~~~~~~~~~~~~
      hdf5-blosc/src/blosc_filter.c:183:46: warning: passing 'char **' to parameter of type 'const char **' discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers]
              code = blosc_compcode_to_compname(compcode, &compname);
                                                          ^~~~~~~~~
      /opt/homebrew/opt/c-blosc/include/blosc.h:359:72: note: passing argument to parameter 'compname' here
      BLOSC_EXPORT int blosc_compcode_to_compname(int compcode, const char **compname);
                                                                             ^
      hdf5-blosc/src/blosc_filter.c:159:10: warning: unused variable 'errmsg' [-Wunused-variable]
          char errmsg[256];
               ^
      3 warnings generated.
      hdf5-blosc/src/blosc_filter.c:182:18: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
              complist = blosc_list_compressors();
                       ^ ~~~~~~~~~~~~~~~~~~~~~~~~
      hdf5-blosc/src/blosc_filter.c:183:46: warning: passing 'char **' to parameter of type 'const char **' discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers]
              code = blosc_compcode_to_compname(compcode, &compname);
                                                          ^~~~~~~~~
      /opt/homebrew/opt/c-blosc/include/blosc.h:359:72: note: passing argument to parameter 'compname' here
      BLOSC_EXPORT int blosc_compcode_to_compname(int compcode, const char **compname);
                                                                             ^
      hdf5-blosc/src/blosc_filter.c:159:10: warning: unused variable 'errmsg' [-Wunused-variable]
          char errmsg[256];
               ^
      3 warnings generated.
      clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -DNDEBUG=1 -DHAVE_BLOSC_LIB=1 -Ihdf5-blosc/src -I/usr/local/include -I/sw/include -I/opt/include -I/opt/local/include -I/usr/include -I/include -I/opt/homebrew/opt/hdf5/include -I/opt/homebrew/opt/c-blosc/include -I/Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/lib/python3.10/site-packages/numpy/core/include -I/Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c src/H5ARRAY.c -o build/temp.macosx-10.9-universal2-cpython-310/src/H5ARRAY.o -Isrc -DH5_USE_18_API -DH5Acreate_vers=2 -DH5Aiterate_vers=2 -DH5Dcreate_vers=2 -DH5Dopen_vers=2 -DH5Eclear_vers=2 -DH5Eprint_vers=2 -DH5Epush_vers=2 -DH5Eset_auto_vers=2 -DH5Eget_auto_vers=2 -DH5Ewalk_vers=2 -DH5E_auto_t_vers=2 -DH5Gcreate_vers=2 -DH5Gopen_vers=2 -DH5Pget_filter_vers=2 -DH5Pget_filter_by_id_vers=2 -DH5Tarray_create_vers=2 -DH5Tget_array_dims_vers=2 -DH5Z_class_t_vers=2
      In file included from src/H5ARRAY.c:4:
      In file included from src/utils.h:2:
      In file included from /Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/lib/python3.10/site-packages/numpy/core/include/numpy/arrayobject.h:5:
      ...
      tables/utilsextension.c:7107:13: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        __pyx_t_1 = blosc_list_compressors();
                  ^ ~~~~~~~~~~~~~~~~~~~~~~~~
      tables/utilsextension.c:7281:55: warning: passing 'char **' to parameter of type 'const char **' discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers]
        __pyx_t_2 = ((blosc_compcode_to_compname(__pyx_t_1, (&__pyx_v_cname)) >= 0) != 0);
                                                            ^~~~~~~~~~~~~~~~
      /opt/homebrew/opt/c-blosc/include/blosc.h:359:72: note: passing argument to parameter 'compname' here
      BLOSC_EXPORT int blosc_compcode_to_compname(int compcode, const char **compname);
                                                                             ^
      tables/utilsextension.c:8092:52: warning: comparison of integers of different signs: 'hsize_t' (aka 'unsigned long long') and 'long long' [-Wsign-compare]
              __pyx_t_2 = (((__pyx_v_maxdims[__pyx_v_i]) == -1LL) != 0);
                             ~~~~~~~~~~~~~~~~~~~~~~~~~~  ^  ~~~~
      tables/utilsextension.c:12375:33: warning: comparison of integers of different signs: 'int' and 'hsize_t' (aka 'unsigned long long') [-Wsign-compare]
        for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
                            ~~~~~~~~~ ^ ~~~~~~~~~
      tables/utilsextension.c:15174:35: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
          for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
                              ~~~~~~~~~ ^ ~~~~~~~~~
      tables/utilsextension.c:15401:52: warning: comparison of integers of different signs: 'hsize_t' (aka 'unsigned long long') and 'long long' [-Wsign-compare]
              __pyx_t_3 = (((__pyx_v_maxdims[__pyx_v_j]) == -1LL) != 0);
                             ~~~~~~~~~~~~~~~~~~~~~~~~~~  ^  ~~~~
      tables/utilsextension.c:22531:22: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                          (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                           ^
      /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:261:7: note: expanded from macro 'PyUnicode_GET_SIZE'
            PyUnicode_WSTR_LENGTH(op) :                    \
            ^
      /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:451:35: note: expanded from macro 'PyUnicode_WSTR_LENGTH'
      #define PyUnicode_WSTR_LENGTH(op) _PyUnicode_get_wstr_length((PyObject*)op)
                                        ^
      /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:445:1: note: '_PyUnicode_get_wstr_length' has been explicitly marked deprecated here
      Py_DEPRECATED(3.3)
      ^
      /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
      #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                           ^
      tables/utilsextension.c:22531:22: warning: 'PyUnicode_AsUnicode' is deprecated [-Wdeprecated-declarations]
                          (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                           ^
      /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:262:14: note: expanded from macro 'PyUnicode_GET_SIZE'
            ((void)PyUnicode_AsUnicode(_PyObject_CAST(op)),\
                   ^
      /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:580:1: note: 'PyUnicode_AsUnicode' has been explicitly marked deprecated here
      Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
      ^
      /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/pyport.h:513:54: note: expanded from macro 'Py_DEPRECATED'
      #define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                           ^
      tables/utilsextension.c:22531:22: warning: '_PyUnicode_get_wstr_length' is deprecated [-Wdeprecated-declarations]
                          (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                           ^
      /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/cpython/unicodeobject.h:264:8: note: expanded from macro 'PyUnicode_GET_SIZE'
             PyUnicode_WSTR_LENGTH(op)))
             ^
      ...
      21 warnings generated.
      In file included from tables/utilsextension.c:612:
      In file included from /Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/lib/python3.10/site-packages/numpy/core/include/numpy/arrayobject.h:5:
      In file included from /Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/lib/python3.10/site-packages/numpy/core/include/numpy/ndarrayobject.h:12:
      In file included from /Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/lib/python3.10/site-packages/numpy/core/include/numpy/ndarraytypes.h:1960:
      /Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/lib/python3.10/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with "          "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
      #warning "Using deprecated NumPy API, disable it with " \
       ^
      tables/utilsextension.c:7107:13: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        __pyx_t_1 = blosc_list_compressors();
                  ^ ~~~~~~~~~~~~~~~~~~~~~~~~
      ...

  × Running setup.py install for scikit-image did not run successfully.
  │ exit code: 1
  ╰─> [802 lines of output]
      /Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/lib/python3.10/site-packages/setuptools/config/setupcfg.py:463: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      /Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/lib/python3.10/site-packages/setuptools/config/setupcfg.py:463: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      Partial import of skimage during the build process.
      Cython >= 0.23.4 not found; falling back to pre-built /private/var/folders/6g/9c7g_2tx2sb7lp8ttwtfky640000gn/T/pip-install-rvfq0tqc/scikit-image_f7f73a95e678433bb155590b9dc1407f/skimage/_shared/geometry.c /private/var/folders/6g/9c7g_2tx2sb7lp8ttwtfky640000gn/T/pip-install-rvfq0tqc/scikit-image_f7f73a95e678433bb155590b9dc1407f/skimage/_shared/transform.c /private/var/folders/6g/9c7g_2tx2sb7lp8ttwtfky640000gn/T/pip-install-rvfq0tqc/scikit-image_f7f73a95e678433bb155590b9dc1407f/skimage/_shared/interpolation.c
      Cython >= 0.23.4 not found; falling back to pre-built /private/var/folders/6g/9c7g_2tx2sb7lp8ttwtfky640000gn/T/pip-install-rvfq0tqc/scikit-image_f7f73a95e678433bb155590b9dc1407f/skimage/draw/_draw.c
    ...
      15 warnings and 6 errors generated.
      error: Command "clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -ftrapping-math -I/Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/lib/python3.10/site-packages/numpy/core/include -I/Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/lib/python3.10/site-packages/numpy/core/include -Ibuild/src.macosx-10.9-universal2-3.10/numpy/distutils/include -I/Users/benjaminfockter/Developer/Python/virtual_envs/test_for_Allen/include -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c skimage/_shared/transform.c -o build/temp.macosx-10.9-universal2-cpython-310/skimage/_shared/transform.o -MMD -MF build/temp.macosx-10.9-universal2-cpython-310/skimage/_shared/transform.o.d" failed with exit status 1
      INFO:
      ########### EXT COMPILER OPTIMIZATION ###########
      INFO: Platform      :
        Architecture: unsupported
        Compiler    : clang

      CPU baseline  :
        Requested   : optimization disabled
        Enabled     : none
        Flags       : none
        Extra checks: none
        Requested   : optimization disabled

      CPU dispatch  :
        Enabled     : none
        Generated   : none
      INFO: CCompilerOpt.cache_flush[825] : write cache to path -> /private/var/folders/6g/9c7g_2tx2sb7lp8ttwtfky640000gn/T/pip-install-rvfq0tqc/scikit-image_f7f73a95e678433bb155590b9dc1407f/build/temp.macosx-10.9-universal2-cpython-310/ccompiler_opt_cache_ext.py
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> scikit-image

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

Environment (please complete the following information):

Additional context

Ran into Issue #426 in the process of install.

Do you want to work on this issue?

No

FBen3 commented 2 years ago

Might be related: Problem when building from source on ARM M1 Mac

aamster commented 2 years ago

Hi @FBen3 python 3.10 is not officially supported. Please try 3.8.

vigji commented 1 year ago

Related to this and to #2602. Python 3.9 libraries overall are much more compatible with the new Mac processor. Moreover, although python=3.7 seems to be the official version recommended in the installation page and the cheatsheet, maybe that could be moved to python=3.8 as there is no python 3.7 build for the os-arm64 processor?

aamster commented 1 year ago

@vigji we are updating supported python versions to 3.7 - 3.9 in the next release (2.14.0, coming soon). We have updated the install instructions to remove mention of 3.7. I am not sure who owns that cheatsheet but I'll try to figure that out.

vigji commented 1 year ago

Awesome!

Jessyjias commented 1 year ago

Hi @FBen3, just wondering were you able to install allenSDK afterwards on Mac M1? I tried install python3.8 and still can't install allenSDK.

`clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly clang: clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly error: Command "clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /Users/jessysong/miniforge3/envs/env_mntest8/include -arch arm64 -fPIC -O2 -isystem /Users/jessysong/miniforge3/envs/env_mntest8/include -arch arm64 -DNPY_INTERNAL_BUILD=1 -DHAVE_NPY_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -DNO_ATLAS_INFO=3 -DHAVE_CBLAS -Ibuild/src.macosx-11.0-arm64-3.8/numpy/core/src/umath -Ibuild/src.macosx-11.0-arm64-3.8/numpy/core/src/npymath -Ibuild/src.macosx-11.0-arm64-3.8/numpy/core/src/common -Inumpy/core/include -Ibuild/src.macosx-11.0-arm64-3.8/numpy/core/include/numpy -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/Users/jessysong/miniforge3/envs/env_mntest8/include/python3.8 -Ibuild/src.macosx-11.0-arm64-3.8/numpy/core/src/common -Ibuild/src.macosx-11.0-arm64-3.8/numpy/core/src/npymath -Ibuild/src.macosx-11.0-arm64-3.8/numpy/core/src/common -Ibuild/src.macosx-11.0-arm64-3.8/numpy/core/src/npymath -c numpy/core/src/multiarray/alloc.c -o build/temp.macosx-11.0-arm64-cpython-38/numpy/core/src/multiarray/alloc.o -MMD -MF build/temp.macosx-11.0-arm64-cpython-38/numpy/core/src/multiarray/alloc.o.d -faltivec -I/System/Library/Frameworks/vecLib.framework/Headers" failed with exit status 1 [end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip.
  error: legacy-install-failure

  × Encountered error while trying to install package.
  ╰─> numpy

  note: This is an issue with the package mentioned above, not pip.
  hint: See above for output from the failure.
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully. │ exit code: 1 ╰─> See above for output. `

rly commented 1 year ago

Some of the pinned dependencies don't play nice with Mac M1. I had to install some packages from conda-forge in order to install allensdk on my Mac M1. I used mambaforge (a faster version of conda that has conda-forge as a default channel). Here are my steps to install allensdk in a clean conda environment:

mamba create --name testenv python=3.8 --yes
mamba activate testenv
mamba install pytables "statsmodels<=0.13.0" "matplotlib==3.4.2" --yes
pip install -U allensdk

# test the installation
python -c "import allensdk"

This also works for python 3.9.

Jessyjias commented 1 year ago

I see, thank you for the info!

For anyone facing similar issues using conda environment on Mac M1, I ended up just setup an x86_64 conda environment (based on Rosetta):

conda activate env_x86
pip install numpy 
pip install allensdk 

Though not ideal (since it's not leveraging M1) it does work.

Some of the pinned dependencies don't play nice with Mac M1. I had to install some packages from conda-forge in order to install allensdk on my Mac M1. I used mambaforge (a faster version of conda that has conda-forge as a default channel). Here are my steps to install allensdk in a clean conda environment:

mamba create --name testenv python=3.8 --yes
mamba activate testenv
mamba install pytables "statsmodels<=0.13.0" "matplotlib==3.4.2" --yes
pip install -U allensdk

# test the installation
python -c "import allensdk"

This also works for python 3.9.

rdgao commented 11 months ago

fyi, I ran into the same issue today on a M1 Mac, and came upon a different solution without Rosetta.

to reproduce:

conda create -n allensdk python=3.8
conda activate allensdk
pip install allensdk

Installation fails when building tables:

Collecting tables (from allensdk)
  Using cached tables-3.8.0.tar.gz (8.0 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
...

An alternate solution was provided here: https://github.com/DeepLabCut/DeepLabCut/issues/2342#issuecomment-1669036527

pip uninstall tables
conda install pytables

Then pip install allensdk finishes successfully.