在Python中安装spleeter模块,最终提示这个代码,导致安装失败,请问怎么解决呢

查看 65|回复 2
作者:htxz2022   
试了一天了,网上找了很多办法最终还是没有解决,请52大神求救[Python] 纯文本查看 复制代码scalarapi.c
        numpy\core\include\numpy/npy_3kcompat.h(210): warning C4244: “=”: 从“Py_ssize_t”转换到“int”,可能丢失数据
        C:\Users\admin\AppData\Local\Temp\pip-install-c7wxu2co\numpy_4aa8d691d02b4e0d86cbd9962cf6da7a\numpy\core\src\multiarray\common.h(239): warning C4244: “return”: 从“npy_uintp”转换到“int”,可能丢失数据
        C:\Users\admin\AppData\Local\Temp\pip-install-c7wxu2co\numpy_4aa8d691d02b4e0d86cbd9962cf6da7a\numpy\core\src\multiarray\common.h(307): warning C4244: “return”: 从“npy_intp”转换到“int”,可能丢失数据
        numpy\core\src\multiarray\scalarapi.c(74): warning C4996: 'PyUnicode_AS_DATA': deprecated in 3.3
        numpy\core\src\multiarray\scalarapi.c(135): warning C4996: 'PyUnicode_AS_DATA': deprecated in 3.3
        numpy\core\src\multiarray\scalarapi.c(326): warning C4244: “函数”: 从“Py_ssize_t”转换到“int”,可能丢失数据
        numpy\core\src\multiarray\scalarapi.c(327): warning C4244: “函数”: 从“npy_intp”转换到“int”,可能丢失数据
        numpy\core\src\multiarray\scalarapi.c(326): warning C4996: 'PyUnicode_GET_SIZE': deprecated in 3.3
        numpy\core\src\multiarray\scalarapi.c(571): warning C4244: “=”: 从“Py_ssize_t”转换到“int”,可能丢失数据
        numpy\core\src\multiarray\scalarapi.c(574): warning C4244: “=”: 从“Py_ssize_t”转换到“int”,可能丢失数据
        numpy\core\src\multiarray\scalarapi.c(574): warning C4996: 'PyUnicode_GET_DATA_SIZE': deprecated in 3.3
        numpy\core\src\multiarray\scalarapi.c(798): error C2106: “=”: 左操作数必须为左值
        error: Command "D:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.35.32215\bin\HostX86\x64\cl.exe /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DNPY_INTERNAL_BUILD=1 -DHAVE_NPY_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -Ibuild\src.win-amd64-3.1\numpy\core\src\umath -Ibuild\src.win-amd64-3.1\numpy\core\src\npymath -Ibuild\src.win-amd64-3.1\numpy\core\src\common -Inumpy\core\include -Ibuild\src.win-amd64-3.1\numpy\core\include/numpy -Inumpy\core\src\common -Inumpy\core\src -Inumpy\core -Inumpy\core\src\npymath -Inumpy\core\src\multiarray -Inumpy\core\src\umath -Inumpy\core\src\npysort -ID:\Program Files\Python\include -ID:\Program Files\Python\Include -Ibuild\src.win-amd64-3.1\numpy\core\src\common -Ibuild\src.win-amd64-3.1\numpy\core\src\npymath -Ibuild\src.win-amd64-3.1\numpy\core\src\common -Ibuild\src.win-amd64-3.1\numpy\core\src\npymath -ID:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.35.32215\include -ID:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.35.32215\ATLMFC\include -ID:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include -ID:\Windows Kits\10\include\10.0.20348.0\ucrt -ID:\Windows Kits\10\\include\10.0.20348.0\\um -ID:\Windows Kits\10\\include\10.0.20348.0\\shared -ID:\Windows Kits\10\\include\10.0.20348.0\\winrt -ID:\Windows Kits\10\\include\10.0.20348.0\\cppwinrt /Tcnumpy\core\src\multiarray\scalarapi.c /Fobuild\temp.win-amd64-cpython-311\Release\numpy\core\src\multiarray\scalarapi.obj" failed with exit status 2
        [end of output]
        note: This error originates from a subprocess, and is likely not a problem with pip.
        ERROR: Failed building wheel for numpy
        Running setup.py clean for numpy
        error: subprocess-exited-with-error
        python setup.py clean did not run successfully.
        exit code: 1
        [10 lines of output]
        Running from numpy source directory.
        `setup.py clean` is not supported, use one of the following instead:
          - `git clean -xdf` (cleans all files)
          - `git clean -Xdf` (cleans all versioned files, doesn't touch
                              files that aren't checked into the git repo)
        Add `--force` to your command to use it anyway if you must (unsupported).
        [end of output]
        note: This error originates from a subprocess, and is likely not a problem with pip.
        ERROR: Failed cleaning build dir for numpy
      Failed to build numpy
      ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
      [end of output]
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install build dependencies 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.

数据, 代码

15820394839   

这个错误看起来是在安装numpy时出现的。可能有一些警告和一个错误,导致numpy无法成功构建和安装。
有几个步骤可以尝试解决这个问题:
更新pip和setuptools。运行以下命令:
pip install --upgrade pip setuptools
确保你安装了Microsoft Visual C++ Build Tools。你可以从这里下载并安装它:https://visualstudio.microsoft.com/visual-cpp-build-tools/
试着安装较旧版本的numpy。运行以下命令:
pip install numpy==1.20.3
如果程序仍然失败,请尝试在安装numpy之前先安装Microsoft Visual C++ 14.x 向导,可从此链接下载 https://my.visualstudio.com/Downloads?q=visual%20c%2B%2B%20build%20tools 然后使用以下命令根据本地python来安装:
pip install --upgrade --force-reinstall --no-binary :all: numpy
如果以上步骤仍不起作用,你可以在安装numpy之前先安装Microsoft Visual C++ 14.x(如果你还没有安装),或者尝试使用anaconda进行安装,本身附带了numpy等科学计算库。也可以考虑使用其他的python发行版进行安装,例如miniconda。
htxz2022
OP
  


15820394839 发表于 2023-5-17 09:13
这个错误看起来是在安装numpy时出现的。可能有一些警告和一个错误,导致numpy无法成功构建和安装。
有几 ...

首先非常感谢大佬的热心解答,以上需要安装的编译器依赖库我都安装完毕并且已经尝试过是无效的,我尝试了降低numpy版本,但是这个问题依然存在,我现在使用的是pycharm
您需要登录后才可以回帖 登录 | 立即注册

返回顶部