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

Update setup.py to support python 3.12.3 #250

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wasertech
Copy link

@wasertech wasertech commented May 28, 2024

Had to update some dependencies too.

❯ python --version
Python 3.12.3
❯ pip show myshell-openvoice
Name: MyShell-OpenVoice
Version: 0.0.0
Summary: Instant voice cloning by MyShell.
Home-page: https://github.com/myshell-ai/OpenVoice
Author: MyShell
Author-email: ethan@myshell.ai
License: MIT License
Location: /home/waser/Projets/Say/src/.venv/lib/python3.12/site-packages
Requires: cn2an, eng-to-ipa, faster-whisper, gradio, inflect, jieba, langid, librosa, numpy, pydub, pypinyin, unidecode, wavmark, whisper-timestamped
Required-by: 

@@ -24,13 +24,13 @@
license='MIT License',
packages=find_packages(),

python_requires='>=3.9',
python_requires='<4',
Copy link
Author

@wasertech wasertech May 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I am really leanant with required python version.You could also decide to only allow for the new version ">=3.9,<=3.12.3" but you would have the same issue for each newer python realeases...

install_requires=[
'librosa==0.9.1',
'faster-whisper==0.9.0',
'faster-whisper==1.0.2',
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had issue with installing faster-whisper 0.9 on py312 so I just updated to lastest version. Fixed install issue:

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [76 lines of output]
      Compiling av/_core.pyx because it changed.
      [1/1] Cythonizing av/_core.pyx
      Compiling av/buffer.pyx because it changed.
      [1/1] Cythonizing av/buffer.pyx
      Compiling av/bytesource.pyx because it changed.
      [1/1] Cythonizing av/bytesource.pyx
      Compiling av/descriptor.pyx because it changed.
      [1/1] Cythonizing av/descriptor.pyx
      Compiling av/dictionary.pyx because it changed.
      [1/1] Cythonizing av/dictionary.pyx
      Compiling av/enum.pyx because it changed.
      [1/1] Cythonizing av/enum.pyx
      Compiling av/error.pyx because it changed.
      [1/1] Cythonizing av/error.pyx
      Compiling av/format.pyx because it changed.
      [1/1] Cythonizing av/format.pyx
      Compiling av/frame.pyx because it changed.
      [1/1] Cythonizing av/frame.pyx
      performance hint: av/logging.pyx:232:5: Exception check on 'log_callback' will always require the GIL to be acquired.
      Possible solutions:
          1. Declare 'log_callback' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
          2. Use an 'int' return type on 'log_callback' to allow an error code to be returned.
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      cdef const char *log_context_name(void *ptr) nogil:
          cdef log_context *obj = <log_context*>ptr
          return obj.name
      
      cdef lib.AVClass log_class
      log_class.item_name = log_context_name
                            ^
      ------------------------------------------------------------
      
      av/logging.pyx:216:22: Cannot assign type 'const char *(void *) except? NULL nogil' to 'const char *(*)(void *) noexcept nogil'. Exception values are incompatible. Suggest adding 'noexcept' to the type of 'log_context_name'.
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      
      # Start the magic!
      # We allow the user to fully disable the logging system as it will not play
      # nicely with subinterpreters due to FFmpeg-created threads.
      if os.environ.get('PYAV_LOGGING') != 'off':
          lib.av_log_set_callback(log_callback)
                                  ^
      ------------------------------------------------------------
      
      av/logging.pyx:351:28: Cannot assign type 'void (void *, int, const char *, va_list) except * nogil' to 'av_log_callback' (alias of 'void (*)(void *, int, const char *, va_list) noexcept nogil'). Exception values are incompatible. Suggest adding 'noexcept' to the type of 'log_callback'.
      Compiling av/logging.pyx because it changed.
      [1/1] Cythonizing av/logging.pyx
      Traceback (most recent call last):
        File "/home/waser/Projets/Say/src/.venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/waser/Projets/Say/src/.venv/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 "/home/waser/Projets/Say/src/.venv/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 "/tmp/pip-build-env-8iz8ncg8/overlay/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 "/tmp/pip-build-env-8iz8ncg8/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-8iz8ncg8/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 487, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-8iz8ncg8/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 157, in <module>
        File "/tmp/pip-build-env-8iz8ncg8/overlay/lib/python3.12/site-packages/Cython/Build/Dependencies.py", line 1154, in cythonize
          cythonize_one(*args)
        File "/tmp/pip-build-env-8iz8ncg8/overlay/lib/python3.12/site-packages/Cython/Build/Dependencies.py", line 1321, in cythonize_one
          raise CompileError(None, pyx_file)
      Cython.Compiler.Errors.CompileError: av/logging.pyx
      [end of output]

'pydub==0.25.1',
'wavmark==0.0.3',
'numpy==1.22.0',
'numpy==1.26.4',
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had issue with numpy 1.22 on py312. Updating to latest version fixed:

× Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [33 lines of output]
      Traceback (most recent call last):
        File "/home/waser/Projets/Say/src/.venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/waser/Projets/Say/src/.venv/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 "/home/waser/Projets/Say/src/.venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 112, in get_requires_for_build_wheel
          backend = _build_backend()
                    ^^^^^^^^^^^^^^^^
        File "/home/waser/Projets/Say/src/.venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 77, in _build_backend
          obj = import_module(mod_path)
                ^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/lib/python3.12/importlib/__init__.py", line 90, in import_module
          return _bootstrap._gcd_import(name[level:], package, level)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
        File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
        File "<frozen importlib._bootstrap>", line 1310, in _find_and_load_unlocked
        File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
        File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
        File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
        File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
        File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
        File "<frozen importlib._bootstrap_external>", line 995, in exec_module
        File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
        File "/tmp/pip-build-env-uq3och34/overlay/lib/python3.12/site-packages/setuptools/__init__.py", line 16, in <module>
          import setuptools.version
        File "/tmp/pip-build-env-uq3och34/overlay/lib/python3.12/site-packages/setuptools/version.py", line 1, in <module>
          import pkg_resources
        File "/tmp/pip-build-env-uq3och34/overlay/lib/python3.12/site-packages/pkg_resources/__init__.py", line 2172, in <module>
          register_finder(pkgutil.ImpImporter, find_on_path)
                          ^^^^^^^^^^^^^^^^^^^
      AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
      [end of output]

@wasertech wasertech changed the title Update setup.py to support python 3.12.2 Update setup.py to support python 3.12.3 May 28, 2024
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 this pull request may close these issues.

None yet

1 participant