Open Zabnarax opened 2 years ago
Agreed. Seeing this same Cython error on Mac in 2024.
AttributeError: module 'collections' has no attribute 'Iterable'
This is due to incompatibilities in newer versions of Python, but the "==" versioning in requirements.txt
(rather than ">=") mandates using incompatible/old versions of Cython.
My solution was to clone the repo, remove "==" in versions of cffi, numpy, and Cython, and then run setup.py
Successfully uninstalled audio_to_midi-2020.7
Geting error: metadata-generation-failed
Cython is installed
~ $ pip install audio-to-midi Collecting audio-to-midi Using cached audio_to_midi-2020.7-py3-none-any.whl (10.0 kB) Collecting cffi==1.12.3 Using cached cffi-1.12.3.tar.gz (456 kB) Preparing metadata (setup.py) ... done Collecting pycparser==2.19 Using cached pycparser-2.19.tar.gz (158 kB) Preparing metadata (setup.py) ... done Collecting SoundFile==0.10.2 Using cached SoundFile-0.10.2-py2.py3-none-any.whl (25 kB) Collecting python3-midi==0.2.5 Using cached python3_midi-0.2.5-py3-none-any.whl (10 kB) Collecting numpy==1.16.3 Using cached numpy-1.16.3.zip (5.1 MB) Preparing metadata (setup.py) ... done Collecting progressbar2==3.50.0 Using cached progressbar2-3.50.0-py2.py3-none-any.whl (51 kB) Collecting Cython==0.29.7 Using cached Cython-0.29.7.tar.gz (2.0 MB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [48 lines of output] Unable to find pgen, not compiling formal grammar. running egg_info creating /data/data/com.termux/files/usr/tmp/pip-pip-egg-info-m9mi5db8/Cython.egg-info writing /data/data/com.termux/files/usr/tmp/pip-pip-egg-info-m9mi5db8/Cython.egg-info/PKG-INFO writing dependency_links to /data/data/com.termux/files/usr/tmp/pip-pip-egg-info-m9mi5db8/Cython.egg-info/dependency_links.txt writing entry points to /data/data/com.termux/files/usr/tmp/pip-pip-egg-info-m9mi5db8/Cython.egg-info/entry_points.txt writing top-level names to /data/data/com.termux/files/usr/tmp/pip-pip-egg-info-m9mi5db8/Cython.egg-info/top_level.txt writing manifest file '/data/data/com.termux/files/usr/tmp/pip-pip-egg-info-m9mi5db8/Cython.egg-info/SOURCES.txt' Traceback (most recent call last): File "", line 2, in
File "", line 34, in
File "/data/data/com.termux/files/usr/tmp/pip-install-dzih8rdl/cython_c67f0572d1bb4c26a36f9864bd48c80d/setup.py", line 228, in
setup(
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/setuptools/init.py", line 87, in setup
return distutils.core.setup(**attrs)
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 148, in setup
return run_commands(dist)
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 163, in run_commands
dist.run_commands()
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands
self.run_command(cmd)
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/setuptools/dist.py", line 1224, in run_command
super().run_command(command)
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
cmd_obj.run()
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 308, in run
self.find_sources()
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 315, in find_sources
mm.run()
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 550, in run
self.add_defaults()
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 587, in add_defaults
sdist.add_defaults(self)
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/setuptools/_distutils/command/sdist.py", line 228, in add_defaults
self._add_defaults_ext()
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/setuptools/_distutils/command/sdist.py", line 311, in _add_defaults_ext
build_ext = self.get_finalized_command('build_ext')
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 299, in get_finalized_command
cmd_obj.ensure_finalized()
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 107, in ensure_finalized
self.finalize_options()
File "/data/data/com.termux/files/usr/tmp/pip-install-dzih8rdl/cython_c67f0572d1bb4c26a36f9864bd48c80d/Cython/Distutils/build_ext.py", line 20, in finalize_options
self.distribution.ext_modules[:] = cythonize(
File "/data/data/com.termux/files/usr/tmp/pip-install-dzih8rdl/cython_c67f0572d1bb4c26a36f9864bd48c80d/Cython/Build/Dependencies.py", line 960, in cythonize
module_list, module_metadata = create_extension_list(
File "/data/data/com.termux/files/usr/tmp/pip-install-dzih8rdl/cython_c67f0572d1bb4c26a36f9864bd48c80d/Cython/Build/Dependencies.py", line 754, in create_extension_list
elif isinstance(patterns, basestring) or not isinstance(patterns, collections.Iterable):
AttributeError: module 'collections' has no attribute 'Iterable'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed
× Encountered error while generating package metadata. ╰─> See above for output.
note: This is an issue with the package mentioned above, not pip. hint: See above for details.
AND
~ $ pip install audio-to-midi --use-deprecated=backtrack-on-build-failures DEPRECATION: Backtracking on build failures can mask issues related to how a package generates metadata or builds a wheel. This flag will be removed in pip 22.2. A possible replacement is avoiding known-bad versions by explicitly telling pip to ignore them (either directly as requirements, or via a constraints file). Discussion can be found at https://github.com/pypa/pip/issues/10655 Collecting audio-to-midi Using cached audio_to_midi-2020.7-py3-none-any.whl (10.0 kB) Collecting Cython==0.29.7 Using cached Cython-0.29.7.tar.gz (2.0 MB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [48 lines of output] Unable to find pgen, not compiling formal grammar. running egg_info creating /data/data/com.termux/files/usr/tmp/pip-pip-egg-info-3ac9j_np/Cython.egg-info writing /data/data/com.termux/files/usr/tmp/pip-pip-egg-info-3ac9j_np/Cython.egg-info/PKG-INFO writing dependency_links to /data/data/com.termux/files/usr/tmp/pip-pip-egg-info-3ac9j_np/Cython.egg-info/dependency_links.txt writing entry points to /data/data/com.termux/files/usr/tmp/pip-pip-egg-info-3ac9j_np/Cython.egg-info/entry_points.txt writing top-level names to /data/data/com.termux/files/usr/tmp/pip-pip-egg-info-3ac9j_np/Cython.egg-info/top_level.txt writing manifest file '/data/data/com.termux/files/usr/tmp/pip-pip-egg-info-3ac9j_np/Cython.egg-info/SOURCES.txt' Traceback (most recent call last): File "", line 2, in
File "", line 34, in
File "/data/data/com.termux/files/usr/tmp/pip-install-plj6c7ce/cython_2f6471e91b254c2db74737d19b61acee/setup.py", line 228, in
setup(
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/setuptools/init.py", line 87, in setup
return distutils.core.setup(**attrs)
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 148, in setup
return run_commands(dist)
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 163, in run_commands
dist.run_commands()
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands
self.run_command(cmd)
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/setuptools/dist.py", line 1224, in run_command
super().run_command(command)
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
cmd_obj.run()
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 308, in run
self.find_sources()
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 315, in find_sources
mm.run()
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 550, in run
self.add_defaults()
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 587, in add_defaults
sdist.add_defaults(self)
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/setuptools/_distutils/command/sdist.py", line 228, in add_defaults
self._add_defaults_ext()
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/setuptools/_distutils/command/sdist.py", line 311, in _add_defaults_ext
build_ext = self.get_finalized_command('build_ext')
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 299, in get_finalized_command
cmd_obj.ensure_finalized()
File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 107, in ensure_finalized
self.finalize_options()
File "/data/data/com.termux/files/usr/tmp/pip-install-plj6c7ce/cython_2f6471e91b254c2db74737d19b61acee/Cython/Distutils/build_ext.py", line 20, in finalize_options
self.distribution.ext_modules[:] = cythonize(
File "/data/data/com.termux/files/usr/tmp/pip-install-plj6c7ce/cython_2f6471e91b254c2db74737d19b61acee/Cython/Build/Dependencies.py", line 960, in cythonize
module_list, module_metadata = create_extension_list(
File "/data/data/com.termux/files/usr/tmp/pip-install-plj6c7ce/cython_2f6471e91b254c2db74737d19b61acee/Cython/Build/Dependencies.py", line 754, in create_extension_list
elif isinstance(patterns, basestring) or not isinstance(patterns, collections.Iterable):
AttributeError: module 'collections' has no attribute 'Iterable'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip. WARNING: Discarding https://files.pythonhosted.org/packages/f8/da/c979464858b257b21a6472a85285548c91f5b4dc773cb049cfdfb3ceeb02/Cython-0.29.7.tar.gz#sha256=55d081162191b7c11c7bfcb7c68e913827dfd5de6ecdbab1b99dab190586c1e8 (from https://pypi.org/simple/cython/) (requires-python:>=2.6, !=3.0., !=3.1., !=3.2.*) due to build failure: metadata generation failed Collecting audio-to-midi Using cached audio_to_midi-2020.6-py3-none-any.whl (9.7 kB) Using cached audio_to_midi-2020.5-py3-none-any.whl (9.6 kB) Using cached audio_to_midi-2020.4-py3-none-any.whl (9.6 kB) Using cached audio_to_midi-2020.3-py3-none-any.whl (9.6 kB) Using cached audio_to_midi-2020.2-py3-none-any.whl (9.1 kB) Using cached audio_to_midi-2020.1-py3-none-any.whl (8.9 kB) Using cached audio_to_midi-2019.3-py3-none-any.whl (8.5 kB) Using cached audio_to_midi-2019.2-py3-none-any.whl (8.4 kB) Using cached audio_to_midi-2019.1-py3-none-any.whl (8.3 kB) ERROR: Cannot install audio-to-midi==2019.1, audio-to-midi==2019.2, audio-to-midi==2019.3, audio-to-midi==2020.1, audio-to-midi==2020.2, audio-to-midi==2020.3, audio-to-midi==2020.4, audio-to-midi==2020.5, audio-to-midi==2020.6 and audio-to-midi==2020.7 because these package versions have conflicting dependencies.
The conflict is caused by: audio-to-midi 2020.7 depends on Cython==0.29.7 audio-to-midi 2020.6 depends on Cython==0.29.7 audio-to-midi 2020.5 depends on Cython==0.29.7 audio-to-midi 2020.4 depends on Cython==0.29.7 audio-to-midi 2020.3 depends on Cython==0.29.7 audio-to-midi 2020.2 depends on Cython==0.29.7 audio-to-midi 2020.1 depends on Cython==0.29.7 audio-to-midi 2019.3 depends on Cython==0.29.7 audio-to-midi 2019.2 depends on Cython==0.29.7 audio-to-midi 2019.1 depends on Cython==0.29.7
To fix this you could try to:
ERROR: ResolutionImpossible