代码之家  ›  专栏  ›  技术社区  ›  syxxzzr

ModuleNotFoundError:没有名为“json”的模块

  •  0
  • syxxzzr  · 技术社区  · 5 月前

    当我跑步的时候 pip install spleeter ,发生错误。 我可以正常导入其他格式的json模型,但这里出现了一个错误。 详细信息如下:

    Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
    Collecting spleeter
      Using cached https://pypi.tuna.tsinghua.edu.cn/packages/10/0b/1ee10015ae2269c1cd1ae5439ae8d48d8680dd984638b4b787d1e4ce4e6b/spleeter-2.1.0-py3-none-any.whl (50 kB)
    Collecting ffmpeg-python==0.2.0 (from spleeter)
      Using cached https://pypi.tuna.tsinghua.edu.cn/packages/d7/0c/56be52741f75bad4dc6555991fabd2e07b432d333da82c11ad701123888a/ffmpeg_python-0.2.0-py3-none-any.whl (25 kB)
    Collecting httpx<0.17.0,>=0.16.1 (from httpx[http2]<0.17.0,>=0.16.1->spleeter)
      Using cached https://pypi.tuna.tsinghua.edu.cn/packages/2d/c6/59aa4188e7eddb9e89ec67a51598ca6bfc09f1b38c9b45f7ee45af7a4df4/httpx-0.16.1-py3-none-any.whl (65 kB)
    Collecting librosa==0.8.0 (from spleeter)
      Using cached https://pypi.tuna.tsinghua.edu.cn/packages/26/4d/c22d8ca74ca2c13cd4ac430fa353954886104321877b65fa871939e78591/librosa-0.8.0.tar.gz (183 kB)
      Preparing metadata (setup.py) ... done
    Collecting norbert==0.2.1 (from spleeter)
      Using cached https://pypi.tuna.tsinghua.edu.cn/packages/22/85/1e4f09c84d28b5541a4a8eece320902c4d2fa264dfe51f779548396f0fea/norbert-0.2.1-py2.py3-none-any.whl (11 kB)
    Collecting numpy<1.19.0,>=1.16.0 (from spleeter)
      Using cached https://pypi.tuna.tsinghua.edu.cn/packages/01/1b/d3ddcabd5817be02df0e6ee20d64f77ff6d0d97f83b77f65e98c8a651981/numpy-1.18.5.zip (5.4 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
      ╰─> [4 lines of output]
          Traceback (most recent call last):
            File "D:\Python\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 15, in <module>
              import json
          ModuleNotFoundError: No module named 'json'
          [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.
    

    我的python版本是3.11.1,pip版本是24.3.1。

    我重试了很多次,但错误并没有消失。 我想跑步 spleeter 我的电脑上没有模型。

    1 回复  |  直到 5 月前
        1
  •  0
  •   Titan    5 月前

    尝试使用虚拟环境,然后在此虚拟环境中安装运行程序所需的所有内容 如果这不起作用,也可以在虚拟环境中尝试更高版本的python,您可以在计算机上安装多个版本的python并在项目中使用您喜欢的版本。