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

魔搭modelscope按官方文档安装音频环境失败

我的安装步骤:
conda create -n modelscope python=3.9
conda activate modelscope
python -m pip install torch==1.11.0 torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113
python -m pip install modelscope[audio] -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html

Windows10 环境、cuda11.7、显卡驱动正常。nvcc正常。

然后开始安装modelscope[audio]后就失败了,失败日志如下:

Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [90 lines of output]
Running from numpy source directory.
:425: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
C:\Users\python\AppData\Local\Temp\pip-install-4o_hm7ce\numpy_c0844180114c43c4a10792bf306150d5\tools\cythonize.py:75: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
required_version = LooseVersion('0.29.13')
C:\Users\python\AppData\Local\Temp\pip-install-4o_hm7ce\numpy_c0844180114c43c4a10792bf306150d5\tools\cythonize.py:77: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
if LooseVersion(cython_version) < required_version:
tion as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
performance hint: _generator.pyx:816:41: Exception check will always require the GIL to be acquired.
Possible solutions:

      1. Declare the function 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 the function to allow an error code to be returned.
  performance hint: _generator.pyx:845:45: Exception check will always require the GIL to be acquired.
  Possible solutions:
      1. Declare the function 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 the function to allow an error code to be returned.

Error compiling Cython file:

  ...
          for i in range(1, RK_STATE_LEN):
              self.rng_state.key[i] = val[i]
          self.rng_state.pos = i

          self._bitgen.state = &self.rng_state
          self._bitgen.next_uint64 = &mt19937_uint64
                                     ^
  ------------------------------------------------------------


  _mt19937.pyx:138:35: Cannot assign type 'uint64_t (*)(void *) except? -1 nogil' to 'uint64_t (*)(void *) noexcept nogil'. Exception values are incompatible. Suggest adding 'noexcept' to type 'uint64_t (void *) except? -1 nogil'.
  Processing numpy/random\_bounded_integers.pxd.in
  Processing numpy/random\mtrand.pyx
  Processing numpy/random\_bit_generator.pyx
  Processing numpy/random\_bounded_integers.pyx.in
  Processing numpy/random\_common.pyx
  Processing numpy/random\_generator.pyx
  Processing numpy/random\_mt19937.pyx
  Traceback (most recent call last):
    File "C:\Users\python\AppData\Local\Temp\pip-install-4o_hm7ce\numpy_c0844180114c43c4a10792bf306150d5\tools\cythonize.py", line 238, in <module>
      main()
    File "C:\Users\python\AppData\Local\Temp\pip-install-4o_hm7ce\numpy_c0844180114c43c4a10792bf306150d5\tools\cythonize.py", line 234, in main
      find_process_files(root_dir)
    File "C:\Users\python\AppData\Local\Temp\pip-install-4o_hm7ce\numpy_c0844180114c43c4a10792bf306150d5\tools\cythonize.py", line 225, in find_process_files
      process(root_dir, fromfile, tofile, function, hash_db)
    File "C:\Users\python\AppData\Local\Temp\pip-install-4o_hm7ce\numpy_c0844180114c43c4a10792bf306150d5\tools\cythonize.py", line 191, in process
      processor_function(fromfile, tofile)
    File "C:\Users\python\AppData\Local\Temp\pip-install-4o_hm7ce\numpy_c0844180114c43c4a10792bf306150d5\tools\cythonize.py", line 80, in process_pyx
      subprocess.check_call(
    File "C:\Users\python\.conda\envs\voice\lib\subprocess.py", line 373, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['C:\\Users\\python\\.conda\\envs\\voice\\python.exe', '-m', 'cython', '-3', '--fast-fail', '-o', '_mt19937.c', '_mt19937.pyx']' returned non-zero exit status 1.
  Cythonizing sources
  Traceback (most recent call last):
    File "C:\Users\python\.conda\envs\voice\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
      main()
    File "C:\Users\python\.conda\envs\voice\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "C:\Users\python\.conda\envs\voice\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 149, in prepare_metadata_for_build_wheel
      return hook(metadata_directory, config_settings)
    File "C:\Users\python\AppData\Local\Temp\pip-build-env-ncvrywby\overlay\Lib\site-packages\setuptools\build_meta.py", line 366, in prepare_metadata_for_build_wheel
      self.run_setup()
    File "C:\Users\python\AppData\Local\Temp\pip-build-env-ncvrywby\overlay\Lib\site-packages\setuptools\build_meta.py", line 480, in run_setup
      super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
    File "C:\Users\python\AppData\Local\Temp\pip-build-env-ncvrywby\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
      exec(code, locals())
    File "<string>", line 450, in <module>
    File "<string>", line 433, in setup_package
    File "<string>", line 240, in generate_cython
  RuntimeError: Running cythonize failed!
  [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.

展开
收起
超大的微笑 2023-11-29 12:50:12 295 1
1 条回答
写回答
取消 提交回答
  • 面对过去,不要迷离;面对未来,不必彷徨;活在今天,你只要把自己完全展示给别人看。

    根据提供的错误日志,问题出在安装 numpy 和 Cython 的过程中。这可能是因为当前的 pip 版本或 numpy 安装源与您的环境不兼容。为了解决这个问题,请尝试以下步骤:

    1. 首先卸载之前安装的 numpy 和 Cython:

      pip uninstall numpy cython
      
    2. 使用 conda 安装 numpy 和 Cython:

      conda install numpy cython
      
    3. 确保您已经正确安装了 torchaudio 和 torch(使用 cu113 版本):

      pip install torch==1.11.0 torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113
      
    4. 最后,尝试重新安装 modelscope[audio]:

      pip install modelscope[audio] -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html
      
    2023-11-30 15:34:46
    赞同 展开评论 打赏

包括语音识别、语音合成、语音唤醒、声学设计及信号处理、声纹识别、音频事件检测等多个领域

相关电子书

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