AI4Bharat / NeMo

Apache License 2.0
3 stars 2 forks source link

Does not work for Python 3.12 #7

Open alvynabranches opened 1 month ago

alvynabranches commented 1 month ago

Describe the bug

Installation process does not work for Python 3.12

Steps/Code to reproduce bug

pip3 install 'nemo_toolkit[all]'
Collecting numpy<1.24,>=1.22 (from nemo_toolkit[all])
  Using cached numpy-1.23.5.tar.gz (10.7 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
  ╰─> [104 lines of output]
      <string>:71: RuntimeWarning: NumPy 1.23.5 may not yet support Python 3.12.
      Running from numpy source directory.
      <string>:86: DeprecationWarning:

        `numpy.distutils` is deprecated since NumPy 1.23.0, as a result
        of the deprecation of `distutils` itself. It will be removed for
        Python >= 3.12. For older Python versions it will remain present.
        It is recommended to use `setuptools < 60.0` for those Python versions.
        For more details, see:
          https://numpy.org/devdocs/reference/distutils_status_migration.html

      running egg_info
      running build_src
      INFO: build_src
      creating numpy.egg-info
      writing numpy.egg-info/PKG-INFO
      writing dependency_links to numpy.egg-info/dependency_links.txt
      writing entry points to numpy.egg-info/entry_points.txt
      writing top-level names to numpy.egg-info/top_level.txt
      writing manifest file 'numpy.egg-info/SOURCES.txt'
      /opt/homebrew/Cellar/python@3.12/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/command/sdist.py:115: SetuptoolsDeprecationWarning: `build_py` command does not inherit from setuptools' `build_py`.
      !!

              ********************************************************************************
              Custom 'build_py' does not implement 'get_data_files_without_manifest'.
              Please extend command classes from setuptools instead of distutils.

              See https://peps.python.org/pep-0632/ for details.
              ********************************************************************************

      !!
        self._add_data_files(self._safe_data_files(build_py))
      INFO: unifing config_cc, config, build_clib, build_ext, build commands --compiler options
      INFO: unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
      Traceback (most recent call last):
        File "/opt/homebrew/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/opt/homebrew/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/opt/homebrew/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/opt/homebrew/Cellar/python@3.12/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/opt/homebrew/Cellar/python@3.12/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "/opt/homebrew/Cellar/python@3.12/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/build_meta.py", line 487, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/opt/homebrew/Cellar/python@3.12/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 494, in <module>
        File "<string>", line 486, in setup_package
        File "/opt/homebrew/Cellar/python@3.12/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/__init__.py", line 103, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/opt/homebrew/Cellar/python@3.12/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "/opt/homebrew/Cellar/python@3.12/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/opt/homebrew/Cellar/python@3.12/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/opt/homebrew/Cellar/python@3.12/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/dist.py", line 963, in run_command
          super().run_command(command)
        File "/opt/homebrew/Cellar/python@3.12/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/private/var/folders/hj/cvl0sf4x1jd8wv__cctlf00m0000gn/T/pip-install-zsr42gix/numpy_babd81b8c96041dc917192c9c282528a/numpy/distutils/command/egg_info.py", line 25, in run
          _egg_info.run(self)
        File "/opt/homebrew/Cellar/python@3.12/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 321, in run
          self.find_sources()
        File "/opt/homebrew/Cellar/python@3.12/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 329, in find_sources
          mm.run()
        File "/opt/homebrew/Cellar/python@3.12/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 550, in run
          self.add_defaults()
        File "/opt/homebrew/Cellar/python@3.12/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 588, in add_defaults
          sdist.add_defaults(self)
        File "/opt/homebrew/Cellar/python@3.12/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/command/sdist.py", line 103, in add_defaults
          self._add_defaults_build_sub_commands()
        File "/opt/homebrew/Cellar/python@3.12/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/command/sdist.py", line 123, in _add_defaults_build_sub_commands
          self.filelist.extend(chain.from_iterable(files))
        File "/opt/homebrew/Cellar/python@3.12/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 493, in extend
          self.files.extend(filter(self._safe_path, paths))
        File "/opt/homebrew/Cellar/python@3.12/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/command/sdist.py", line 122, in <genexpr>
          files = (c.get_source_files() for c in cmds if hasattr(c, "get_source_files"))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/opt/homebrew/Cellar/python@3.12/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/command/sdist.py", line 121, in <genexpr>
          cmds = (self.get_finalized_command(c) for c in missing_cmds)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/opt/homebrew/Cellar/python@3.12/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 305, in get_finalized_command
          cmd_obj.ensure_finalized()
        File "/opt/homebrew/Cellar/python@3.12/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 111, in ensure_finalized
          self.finalize_options()
        File "/private/var/folders/hj/cvl0sf4x1jd8wv__cctlf00m0000gn/T/pip-install-zsr42gix/numpy_babd81b8c96041dc917192c9c282528a/numpy/distutils/command/config_compiler.py", line 69, in finalize_options
          v = getattr(c, a)
              ^^^^^^^^^^^^^
        File "/private/var/folders/hj/cvl0sf4x1jd8wv__cctlf00m0000gn/T/pip-build-env-sfgztpi6/overlay/lib/python3.12/site-packages/Cython/Distutils/old_build_ext.py", line 157, in __getattr__
          return _build_ext.build_ext.__getattr__(self, name)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/opt/homebrew/Cellar/python@3.12/3.12.6/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 107, in __getattr__
          raise AttributeError(attr)
      AttributeError: fcompiler. Did you mean: 'compiler'?
      [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.

Expected behavior

Support for newer version that supports Python 3.12 should be available. Python3 is backward compatible, update the libraries accordingly.

Environment overview (please complete the following information)

Environment details

No GPU Python 3.12.6

github-actions[bot] commented 13 hours ago

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.