开发者社区 > ModelScope模型即服务 > 正文

modelscope[audio] pysptk 安装报错

Building wheels for collected packages: pysptk
Building wheel for pysptk (pyproject.toml) ... error
error: subprocess-exited-with-error

× Building wheel for pysptk (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [109 lines of output]
fatal: Not a git repository (or any of the parent directories): .git
:58: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
/tmp/pip-build-env-truxtbgl/overlay/lib/python3.9/site-packages/setuptools/dist.py:745: SetuptoolsDeprecationWarning: Invalid dash-separated options
!!

          ********************************************************************************
          Usage of dash-separated 'index-url' will not be supported in future
          versions. Please use the underscore name 'index_url' instead.

          By 2023-Sep-26, you need to update your project and remove deprecated calls
          or your builds will no longer be supported.

          See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
          ********************************************************************************

  !!
    opt = self.warn_dash_deprecation(opt, section)
  running bdist_wheel
  running build
  running build_py
  -- Building version 0.1.21
  creating build
  creating build/lib.linux-x86_64-cpython-39
  creating build/lib.linux-x86_64-cpython-39/pysptk
  copying pysptk/version.py -> build/lib.linux-x86_64-cpython-39/pysptk
  copying pysptk/synthesis.py -> build/lib.linux-x86_64-cpython-39/pysptk
  copying pysptk/__init__.py -> build/lib.linux-x86_64-cpython-39/pysptk
  copying pysptk/sptk.py -> build/lib.linux-x86_64-cpython-39/pysptk
  copying pysptk/conversion.py -> build/lib.linux-x86_64-cpython-39/pysptk
  copying pysptk/util.py -> build/lib.linux-x86_64-cpython-39/pysptk
  creating build/lib.linux-x86_64-cpython-39/pysptk/example_audio_data
  copying pysptk/example_audio_data/COPYING -> build/lib.linux-x86_64-cpython-39/pysptk/example_audio_data
  copying pysptk/example_audio_data/arctic_a0007.wav -> build/lib.linux-x86_64-cpython-39/pysptk/example_audio_data
  running build_ext
  /tmp/pip-build-env-truxtbgl/overlay/lib/python3.9/site-packages/Cython/Compiler/Main.py:381: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /tmp/pip-install-v_sqt4o4/pysptk_27e61f1c126543d681e01bee0e512b34/pysptk/_sptk.pxd
    tree = Parsing.p_module(s, pxd, full_module_name)

  Error compiling Cython file:
  ------------------------------------------------------------
  ...

  import numpy as np
  cimport numpy as np

  cimport cython
  cimport _sptk
          ^
  ------------------------------------------------------------

  pysptk/_sptk.pyx:8:8: '_sptk.pxd' not found
  Compiling pysptk/_sptk.pyx because it changed.
  [1/1] Cythonizing pysptk/_sptk.pyx
  Traceback (most recent call last):
    File "/root/miniconda/envs/modelscope/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/root/miniconda/envs/modelscope/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 "/root/miniconda/envs/modelscope/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
      return _build_backend().build_wheel(wheel_directory, config_settings,
    File "/tmp/pip-build-env-truxtbgl/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 416, in build_wheel
      return self._build_with_temp_dir(['bdist_wheel'], '.whl',
    File "/tmp/pip-build-env-truxtbgl/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 401, in _build_with_temp_dir
      self.run_setup()
    File "/tmp/pip-build-env-truxtbgl/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 487, in run_setup
      super(_BuildMetaLegacyBackend,
    File "/tmp/pip-build-env-truxtbgl/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 338, in run_setup
      exec(code, locals())
    File "<string>", line 136, in <module>
    File "/tmp/pip-build-env-truxtbgl/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 107, in setup
      return distutils.core.setup(**attrs)
    File "/tmp/pip-build-env-truxtbgl/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setup
      return run_commands(dist)
    File "/tmp/pip-build-env-truxtbgl/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
      dist.run_commands()
    File "/tmp/pip-build-env-truxtbgl/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "/tmp/pip-build-env-truxtbgl/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1234, in run_command
      super().run_command(command)
    File "/tmp/pip-build-env-truxtbgl/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-env-truxtbgl/overlay/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 346, in run
      self.run_command("build")
    File "/tmp/pip-build-env-truxtbgl/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "/tmp/pip-build-env-truxtbgl/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1234, in run_command
      super().run_command(command)
    File "/tmp/pip-build-env-truxtbgl/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-env-truxtbgl/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build.py", line 131, in run
      self.run_command(cmd_name)
    File "/tmp/pip-build-env-truxtbgl/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "/tmp/pip-build-env-truxtbgl/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1234, in run_command
      super().run_command(command)
    File "/tmp/pip-build-env-truxtbgl/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-env-truxtbgl/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
      self.build_extensions()
    File "/tmp/pip-build-env-truxtbgl/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 467, in build_extensions
      self._build_extensions_serial()
    File "/tmp/pip-build-env-truxtbgl/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 493, in _build_extensions_serial
      self.build_extension(ext)
    File "/tmp/pip-build-env-truxtbgl/overlay/lib/python3.9/site-packages/Cython/Distutils/build_ext.py", line 122, in build_extension
      new_ext = cythonize(
    File "/tmp/pip-build-env-truxtbgl/overlay/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1134, in cythonize
      cythonize_one(*args)
    File "/tmp/pip-build-env-truxtbgl/overlay/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1301, in cythonize_one
      raise CompileError(None, pyx_file)
  Cython.Compiler.Errors.CompileError: pysptk/_sptk.pyx
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pysptk
Failed to build pysptk
ERROR: Could not build wheels for pysptk, which is required to install pyproject.toml-based projects
有人知道怎么解决吗 着急啊

展开
收起
1814504662429547 2023-07-27 19:45:40 1495 0
4 条回答
写回答
取消 提交回答
  • 看到前面三个回答也是服了,阿里云开发者社区的人也就这水平,三个都解决不了问题的还好意思发出来,自己验证过了吗?还好我在GitHub上看到了正确答案
    Looks like the problem is the recent Cython release. You can work around the issue by:

    downgrading/restricting Cython cython version below 3.0.0
    `pip install --upgrade Cython==0.29.35
    using --no-build-isolation flag
    pip install pysptk --no-build-isolation

    是Cython 的版本太高了,遇到这个问题的开发者先确认一下Cython 版本是不是大于3.0,
    Cython==0.29.35降低版本就能把modelscope[audio] 安装成功了,亲测
    image.png

    image.png

    2024-01-13 21:29:48
    赞同 1 展开评论 打赏
  • 这个错误是由于构建pysptk的wheel失败导致的,并不是pip本身的问题。要解决这个问题,你可以尝试以下几个步骤:

    1. 确保你的系统上已经安装了所有必需的构建工具。对于Windows系统,你可以安装Microsoft Visual C++ Build Tools。对于Linux系统,你需要安装gcc和其他必需的构建工具。

    2. 确保你已经安装了pysptk的依赖项。你可以查阅pysptk的文档或者官方网站来获取依赖项的列表,并确保它们已经正确安装。

    3. 尝试使用最新版本的pip和setuptools。你可以使用以下命令升级它们:

      pip install --upgrade pip setuptools
      
    4. 如果你正在使用虚拟环境,请确保你已经正确激活了虚拟环境,并且在激活的环境中运行pip安装命令。

    2023-07-30 21:58:59
    赞同 展开评论 打赏
  • 北京阿里云ACE会长

    这个错误一般是由于编译Pysptk的C核心代码时出现了问题。为了解决这个问题,您可以尝试以下几种方法:

    安装编译工具:在安装Pysptk之前,需要先安装一些编译工具,例如GCC和Python开发包。您可以尝试使用以下命令安装这些工具:

    Copy
    sudo apt-get install build-essential python-dev
    ```

    如果您正在使用其他操作系统,请使用相应的包管理器安装这些工具。

    安装依赖库:Pysptk依赖于一些其他的库,例如NumPy和SciPy。您可以尝试使用以下命令安装这些库:

    Copy
    pip install numpy scipy
    检查环境:在安装Pysptk之前,需要确保您的环境配置正确。您可以尝试使用以下命令检查您的环境配置:

    Copy
    python -c "import sys; print(sys.path)"
    如果发现缺少某些路径,请将这些路径添加到PYTHONPATH环境变量中。

    降低Pysptk版本:如果以上方法都无法解决问题,您可以尝试安装较旧版本的Pysptk。您可以使用以下命令安装Pysptk的一个较旧版本:

    Copy
    pip install pysptk==0.1.17

    2023-07-28 13:13:29
    赞同 展开评论 打赏
  • 这个报错提示表明在安装pysptk时出现了问题。这可能是由于缺少一些必要的编译依赖项导致的。以下是一些可能的解决方案:

    1. 确保已安装所有必要的编译依赖项:在安装pysptk之前,您需要确保操作系统上已安装了所需的编译工具和库。具体来说,您可能需要安装Cython、NumPy等。根据您使用的操作系统和软件包管理器,可以尝试执行以下命令安装这些依赖项:

      • 在Ubuntu上:sudo apt-get install cython
      • 在CentOS上:sudo yum install cython
      • 在macOS上(使用Homebrew):brew install cython
    2. 更新pip和setuptools:确保您的pip和setuptools版本是最新的。可以通过运行以下命令进行更新:

      python -m pip install --upgrade pip setuptools

    3. 安装PYSPTK的依赖项:尝试手动安装PYSPTK所需的其他依赖项,例如CFFI和FFTW。您可以运行以下命令安装它们:

      pip install cffi fftw

    4. 使用预编译的二进制文件:如果以上方法仍然无法解决问题,您可以尝试使用预编译的二进制文件进行安装。首先,从PYSPTK的官方发布页面(https://github.com/r9y9/pysptk/releases)下载与您的操作系统和Python版本兼容的预编译文件。然后使用命令`pip install <预编译文件路径>`进行安装。

    2023-07-27 20:59:02
    赞同 展开评论 打赏

ModelScope旨在打造下一代开源的模型即服务共享平台,为泛AI开发者提供灵活、易用、低成本的一站式模型服务产品,让模型应用更简单!欢迎加入技术交流群:微信公众号:魔搭ModelScope社区,钉钉群号:44837352

相关电子书

更多
视觉AI能力的开放现状及ModelScope实战 立即下载
ModelScope助力语音AI模型创新与应用 立即下载
低代码开发师(初级)实战教程 立即下载