Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install conda env on Mac M1 #395

Closed
rly opened this issue Sep 27, 2023 · 0 comments · Fixed by #396
Closed

Cannot install conda env on Mac M1 #395

rly opened this issue Sep 27, 2023 · 0 comments · Fixed by #396

Comments

@rly
Copy link
Collaborator

rly commented Sep 27, 2023

With the update to the conda environment file for Mac M1 to install the full version of neuroconv, pytables is installed. However, pytables has not released a macos arm64 wheel on PyPI, and building pytables on a Mac M1 results in a build error related to hdf5 because it is not yet installed:

Collecting tables (from neuroconv@ git+https://github.com/catalystneuro/neuroconv.git@main#neuroconv[full]->-r /Users/rly/Documents/NWB/nwb-guide/environments/condaenv.6j96x3bd.requirements.txt (line 6))
  Using cached tables-3.8.0.tar.gz (8.0 MB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'error'

Pip subprocess error:
  Running command git clone --filter=blob:none --quiet https://github.com/catalystneuro/neuroconv.git /private/var/folders/cp/nh4x2lls1qq03jh58crvh8t00000gp/T/pip-install-1tdukxb1/neuroconv_852440243b6a40e1872cab98ef6f834f
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [12 lines of output]
      <string>:19: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
      ld: library not found for -lhdf5
      clang: error: linker command failed with exit code 1 (use -v to see invocation)
      cpuinfo failed, assuming no CPU features: 'flags'
      * Using Python 3.9.18 | packaged by conda-forge | (main, Aug 30 2023, 03:53:08)
      * Found cython 3.0.2
      * USE_PKGCONFIG: False
      * Found conda env: ``/Users/rly/mambaforge/envs/nwb-guide``
      .. ERROR:: Could not find a local HDF5 installation.
         You may need to explicitly state where your local HDF5 headers and
         library can be found by setting the ``HDF5_DIR`` environment
         variable or by using the ``--hdf5`` command-line option.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

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

failed

CondaEnvException: Pip failed

Installing HDF5 first does not resolve the error. I get a linking error from pytables instead.

Collecting tables (from neuroconv@ git+https://github.com/catalystneuro/neuroconv.git@main#neuroconv[full]->-r /Users/rly/Documents/NWB/nwb-guide/environments/condaenv.044m0nux.requirements.txt (line 6))
  Using cached tables-3.8.0.tar.gz (8.0 MB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'error'

Pip subprocess error:
  Running command git clone --filter=blob:none --quiet https://github.com/catalystneuro/neuroconv.git /private/var/folders/cp/nh4x2lls1qq03jh58crvh8t00000gp/T/pip-install-wrclyt0f/neuroconv_398f117b8175446da0bf1f4223d6d088
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [55 lines of output]
      <string>:19: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
      ld: library not found for -llzo2
      clang: error: linker command failed with exit code 1 (use -v to see invocation)
      ld: library not found for -llzo
      clang: error: linker command failed with exit code 1 (use -v to see invocation)
      ld: library not found for -lblosc
      clang: error: linker command failed with exit code 1 (use -v to see invocation)
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      
      
      def _dump_h5_backtrace():
          cdef object bt = []
      
          if H5Ewalk(H5E_DEFAULT, H5E_WALK_DOWNWARD, e_walk_cb, <void*>bt) < 0:
                                                     ^
      ------------------------------------------------------------
      
      tables/utilsextension.pyx:384:47: Cannot assign type 'herr_t (unsigned int, const H5E_error_t *, void *) except? -1 nogil' to 'H5E_walk_t'. Exception values are incompatible. Suggest adding 'noexcept' to type 'herr_t (unsigned int, const H5E_error_t *, void *) except? -1 nogil'.
      cpuinfo failed, assuming no CPU features: 'flags'
      * Using Python 3.9.18 | packaged by conda-forge | (main, Aug 30 2023, 03:53:08)
      * Found cython 3.0.2
      * USE_PKGCONFIG: False
      * Found conda env: ``/Users/rly/mambaforge/envs/nwb-guide``
      * Found HDF5 headers at ``/Users/rly/mambaforge/envs/nwb-guide/include``, library at ``/Users/rly/mambaforge/envs/nwb-guide/lib``.
      * Could not find LZO 2 headers and library; disabling support for it.
      * Could not find LZO 1 headers and library; disabling support for it.
      * Found bzip2 headers at ``/Users/rly/mambaforge/envs/nwb-guide/include``, library at ``/Users/rly/mambaforge/envs/nwb-guide/lib``.
      * Could not find blosc headers and library; using internal sources.
      * Found blosc2 headers at ``/private/var/folders/cp/nh4x2lls1qq03jh58crvh8t00000gp/T/pip-build-env-jwqxo1tp/overlay/include``, library at ``/private/var/folders/cp/nh4x2lls1qq03jh58crvh8t00000gp/T/pip-build-env-jwqxo1tp/overlay/lib``.
        * Copying blosc2 runtime library to 'tables' dir because it was not found in standard locations
      Compiling tables/utilsextension.pyx because it changed.
      [1/1] Cythonizing tables/utilsextension.pyx
      Traceback (most recent call last):
        File "/Users/rly/mambaforge/envs/nwb-guide/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Users/rly/mambaforge/envs/nwb-guide/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/Users/rly/mambaforge/envs/nwb-guide/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/private/var/folders/cp/nh4x2lls1qq03jh58crvh8t00000gp/T/pip-build-env-jwqxo1tp/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 355, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "/private/var/folders/cp/nh4x2lls1qq03jh58crvh8t00000gp/T/pip-build-env-jwqxo1tp/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 325, in _get_build_requires
          self.run_setup()
        File "/private/var/folders/cp/nh4x2lls1qq03jh58crvh8t00000gp/T/pip-build-env-jwqxo1tp/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 341, in run_setup
          exec(code, locals())
        File "<string>", line 928, in <module>
        File "<string>", line 923, in get_cython_extfiles
        File "/private/var/folders/cp/nh4x2lls1qq03jh58crvh8t00000gp/T/pip-build-env-jwqxo1tp/overlay/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1134, in cythonize
          cythonize_one(*args)
        File "/private/var/folders/cp/nh4x2lls1qq03jh58crvh8t00000gp/T/pip-build-env-jwqxo1tp/overlay/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1301, in cythonize_one
          raise CompileError(None, pyx_file)
      Cython.Compiler.Errors.CompileError: tables/utilsextension.pyx
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

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

failed

CondaEnvException: Pip failed

To resolve this, we should install pytables from conda-forge in the conda env file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant