Skip to content

Installation fails #550

@hphaavikko

Description

@hphaavikko

Trying to install madmom with pip install madmom fails with the following error:

Collecting madmom
  Using cached madmom-0.16.1.tar.gz (20.0 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [20 lines of output]
      Traceback (most recent call last):
        File "/Users/xxx/.pyenv/versions/3.11.12/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Users/xxx/.pyenv/versions/3.11.12/lib/python3.11/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/xxx/.pyenv/versions/3.11.12/lib/python3.11/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/d8/nrd3xf9s6_gf1vm2t326gsxr0000gn/T/pip-build-env-cufkkn2l/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 331, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/d8/nrd3xf9s6_gf1vm2t326gsxr0000gn/T/pip-build-env-cufkkn2l/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 301, in _get_build_requires
          self.run_setup()
        File "/private/var/folders/d8/nrd3xf9s6_gf1vm2t326gsxr0000gn/T/pip-build-env-cufkkn2l/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 512, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/private/var/folders/d8/nrd3xf9s6_gf1vm2t326gsxr0000gn/T/pip-build-env-cufkkn2l/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 317, in run_setup
          exec(code, locals())
        File "<string>", line 12, in <module>
      ModuleNotFoundError: No module named 'Cython'

I have Cython installed, doing pip list shows Cython 3.1.0. I have also the other required dependencies (numpy, scipy and mido) installed.

Apparently some have had this same issue and one suggested solution was to install madmom straight from GitHub. So I tried pip install git+https://github.com/CPJKU/madmom but it also fails, although with a different error:

Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [84 lines of output]
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      from scipy.ndimage import correlate1d
      
      cimport numpy as np
      cimport cython
      
      from numpy.math cimport INFINITY
      ^
      ------------------------------------------------------------
      
      madmom/features/beats_crf.pyx:26:0: 'numpy/math.pxd' not found
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      from scipy.ndimage import correlate1d
      
      cimport numpy as np
      cimport cython
      
      from numpy.math cimport INFINITY
      ^
      ------------------------------------------------------------
      
      madmom/features/beats_crf.pyx:26:0: 'numpy/math/INFINITY.pxd' not found
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
              v_p[i] = pi[i] + activations[i] + norm_factor[i]
      
          # iterate over all beats; the 1st beat is given by prior
          for k in range(num_x - 1):
              # reset all current viterbi variables
              v_c[:] = -INFINITY
                        ^
      ------------------------------------------------------------
      
      madmom/features/beats_crf.pyx:200:18: 'INFINITY' is not a constant, variable or function identifier
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
                  v_c[i] += activations[i] + norm_factor[i]
      
              v_p, v_c = v_c, v_p
      
          # add the final best state to the path
          path_prob = -INFINITY
                       ^
      ------------------------------------------------------------
      
      madmom/features/beats_crf.pyx:226:17: 'INFINITY' is not a constant, variable or function identifier
      Compiling madmom/audio/comb_filters.pyx because it changed.
      Compiling madmom/features/beats_crf.pyx because it changed.
      Compiling madmom/ml/hmm.pyx because it changed.
      Compiling madmom/ml/nn/layers.py because it changed.
      [1/4] Cythonizing madmom/audio/comb_filters.pyx
      [2/4] Cythonizing madmom/features/beats_crf.pyx
      Traceback (most recent call last):
        File "/Users/xxx/.pyenv/versions/3.11.12/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Users/xxx/.pyenv/versions/3.11.12/lib/python3.11/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/xxx/.pyenv/versions/3.11.12/lib/python3.11/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/d8/nrd3xf9s6_gf1vm2t326gsxr0000gn/T/pip-build-env-f92pp7fd/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 331, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/d8/nrd3xf9s6_gf1vm2t326gsxr0000gn/T/pip-build-env-f92pp7fd/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 301, in _get_build_requires
          self.run_setup()
        File "/private/var/folders/d8/nrd3xf9s6_gf1vm2t326gsxr0000gn/T/pip-build-env-f92pp7fd/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 317, in run_setup
          exec(code, locals())
        File "<string>", line 98, in <module>
        File "/private/var/folders/d8/nrd3xf9s6_gf1vm2t326gsxr0000gn/T/pip-build-env-f92pp7fd/overlay/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1145, in cythonize
          cythonize_one(*args)
        File "/private/var/folders/d8/nrd3xf9s6_gf1vm2t326gsxr0000gn/T/pip-build-env-f92pp7fd/overlay/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1289, in cythonize_one
          raise CompileError(None, pyx_file)
      Cython.Compiler.Errors.CompileError: madmom/features/beats_crf.pyx

I'm using MacOS (M1) and Python 3.11.12. Also tried installing in a Docker container with several different Python versions but the installation fails there in the same way too. Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions