在Windows 10上安装numba和llvmlite Python失败

在Windows 10上安装numba和llvmlite Python失败,python,windows,numba,llvmlite,Python,Windows,Numba,Llvmlite,在Windows 10上安装numba和llvmlite Python失败 我曾尝试在Windows 10上使用 pip安装numba 部分成功,但安装llvmlite失败 Requirement already satisfied: numpy>=1.15 in c:\users\paul\appdata\local\programs\python\python39\lib\site-packages (from numba) (1.19.2+mkl) Requirement alrea

在Windows 10上安装numba和llvmlite Python失败

我曾尝试在Windows 10上使用

pip安装numba

部分成功,但安装llvmlite失败

Requirement already satisfied: numpy>=1.15 in c:\users\paul\appdata\local\programs\python\python39\lib\site-packages (from numba) (1.19.2+mkl)
Requirement already satisfied: setuptools in c:\users\paul\appdata\local\programs\python\python39\lib\site-packages (from numba) (49.2.1)
Building wheels for collected packages: numba, llvmlite
  Building wheel for numba (setup.py) ... done
  Created wheel for numba: filename=numba-0.51.2-cp39-cp39-win_amd64.whl size=2173229 sha256=249a12f2e1436ac244e2730f6e7ddb5bd53413460dcbdc4ed4e6aeebbf16d6ce
  Stored in directory: c:\users\paul\appdata\local\pip\cache\wheels\0a\51\41\9f5a61bcd9d25271d7021e05cbabcd574fb3d534d07654b780
  Building wheel for llvmlite (setup.py) ... error
  ERROR: Command errored out with exit status 1:
  
    CMake Error at CMakeLists.txt:9 (find_package):
      Could not find a package configuration file provided by "LLVM" with any of
      the following names:

        LLVMConfig.cmake
        llvm-config.cmake

      Add the installation prefix of "LLVM" to CMAKE_PREFIX_PATH or set
      "LLVM_DIR" to a directory containing one of the above files.  If "LLVM"
      provides a separate development package or SDK, be sure it has been installed.

    -- Configuring incomplete, errors occurred!
不知道LLVM安装在哪里

因此,我使用Windows环境编辑器添加了LLVM_DIR,其值为C:\Program Files\mingw-w64\winlibs-x86_64-posix-seh-gcc-9.3.0-LLVM-10.0.0-mingw-w64-7.0.0-r4\mingw64\lib\cmake\LLVM

希望它能使用我在C:\LLVM\Clang-1100、C:\LLVM\Clang-1000安装的四个Clang版本中的一个。。。 最新的二进制文件是C:\LLVM\clang-1100\LLVM\bin

我还安装了VS1017和1019,并且所有的编译器都可以从其他IDE和构建中正常工作

下载了最新的轮子

llvmlite-0.34.0-cp39-cp39-win_amd64.whl

并将LLVM_DIR添加到系统路径

C:\ProgramFiles\mingw-w64\winlibs-x86\u 64-posix-seh-gcc-9.3.0-llvm-10.0.0-mingw-w64-7.0.0-r4\mingw64\lib\cmake\llvm

这使得它可以更接近工作,但使用MSVC失败

   Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
    Copyright (C) Microsoft Corporation. All rights reserved.

    C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(399,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\Paul\AppData\Local\Temp\pip-install-xvvf77_z\llvmlite\ffi\build\ZERO_CHECK.vcxproj]
    C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(399,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\Paul\AppData\Local\Temp\pip-install-xvvf77_z\llvmlite\ffi\build\llvmlite.vcxproj]
    LINK : fatal error LNK1181: cannot open input file 'D:\winlibs64_stage\custombuilt\lib\libffi.dll.a' [C:\Users\Paul\AppData\Local\Temp\pip-install-xvvf77_z\llvmlite\ffi\build\llvmlite.vcxproj]
    Trying generator 'Visual Studio 15 2017 Win64'
    Traceback (most recent call last):
      File "C:\Users\Paul\AppData\Local\Temp\pip-install-xvvf77_z\llvmlite\ffi\build.py", line 191, in <module>
        main()
      File "C:\Users\Paul\AppData\Local\Temp\pip-install-xvvf77_z\llvmlite\ffi\build.py", line 179, in main
        main_win32()
      File "C:\Users\Paul\AppData\Local\Temp\pip-install-xvvf77_z\llvmlite\ffi\build.py", line 94, in main_win32
        subprocess.check_call(['cmake', '--build', build_dir, '--config', config])
      File "c:\users\paul\appdata\local\programs\python\python39\lib\subprocess.py", line 373, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['cmake', '--build', 'C:\\Users\\Paul\\AppData\\Local\\Temp\\pip-install-xvvf77_z\\llvmlite\\ffi\\build', '--config', 'Release']' returned non-zero exit status 1.
    error: command 'c:\\users\\paul\\appdata\\local\\programs\\python\\python39\\python.exe' failed with exit code 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\paul\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Paul\\AppData\\Local\\Temp\\pip-install-xvvf77_z\\llvmlite\\setup.py'"'"'; __file__='"'"'C:\\Users\\Paul\\AppData\\Local\\Temp\\pip-install-xvvf77_z\\llvmlite\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Paul\AppData\Local\Temp\pip-record-l4absc_g\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\paul\appdata\local\programs\python\python39\Include\llvmlite' Check the logs for full command output.
Microsoft(R)为.NET Framework构建引擎版本15.9.21+g9802d43bc3
版权所有(C)微软公司。版权所有。
C:\Program Files(x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(399,5):警告MSB8029:中间目录或输出目录不能位于临时目录下,因为它可能导致增量生成问题。[C:\Users\Paul\AppData\Local\Temp\pip-install-xvvf77_z\llvmlite\ffi\build\ZERO_CHECK.vcxproj]
C:\Program Files(x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(399,5):警告MSB8029:中间目录或输出目录不能位于临时目录下,因为它可能导致增量生成问题。[C:\Users\Paul\AppData\Local\Temp\pip-install-xvvf77_z\llvmlite\ffi\build\llvmlite.vcxproj]
链接:致命错误LNK1181:无法打开输入文件“D:\winlibs64_stage\CustomBuild\lib\libffi.dll.a”[C:\Users\Paul\AppData\Local\Temp\pip-install-xvvf77_z\llvmlite\ffi\build\llvmlite.vcxproj]
正在尝试生成器“Visual Studio 15 2017 Win64”
回溯(最近一次呼叫最后一次):
文件“C:\Users\Paul\AppData\Local\Temp\pip-install-xvvf77_z\llvmlite\ffi\build.py”,第191行,在
main()
文件“C:\Users\Paul\AppData\Local\Temp\pip-install-xvvf77_z\llvmlite\ffi\build.py”,第179行,主目录
main_win32()
文件“C:\Users\Paul\AppData\Local\Temp\pip-install-xvvf77_z\llvmlite\ffi\build.py”,第94行,在main_win32中
子进程。检查_调用(['cmake','--build',build_dir',--config',config])
文件“c:\users\paul\appdata\local\programs\python\python39\lib\subprocess.py”,第373行,在check\u调用中
引发被调用的进程错误(retcode,cmd)
subprocess.CalledProcessError:命令'['cmake','--build','C:\\Users\\Paul\\AppData\\Local\\Temp\\pip-install-xvvf77_z\\llvmlite\\ffi\\build','--config','Release']'返回非零退出状态1。
错误:命令“c:\\users\\paul\\appdata\\local\\programs\\python\\python39\\python.exe”失败,退出代码为1
----------------------------------------
错误:退出状态为1的命令出错:“c:\users\paul\appdata\local\programs\python\python39\python.exe'-u-c”import sys,setuptools,tokenize;sys.argv[0]=“C:\\Users\\Paul\\AppData\\Local\\Temp\\pip-install-xvvf77\u z\\llvmlite\\setup.py”“”__文件“'''''C:\\Users\\Paul\\AppData\\Local\\Temp\\pip-install-xvvf77\u z\\llvmlite\\setup.py''”;f=getattr(标记化,“'open'”,open)(\uuuuu文件);code=f.read().replace(“\r\n”“”、“\n”“”);f、 close();exec(compile(code,_ufile,“'exec'”)'安装--record'C:\Users\Paul\AppData\Local\Temp\pip-record-l4absc\u g\install record.txt'--外部管理的单一版本--编译--安装头'C:\Users\Paul\AppData\Local\programs\python\python39\Include\llvmlite'检查日志以获得完整的命令输出。
这表明未指定输出文件夹位置,或者VS增量生成选项未设置为“未使用”

或者我应该使用LLVM版本,但我不知道如何指定哪个版本,并且不使用VS2017

建议如何走出这个兔子洞最受欢迎;-)

谢谢


Paul

我想安装
librosa
,但我遇到了这个错误,但我成功地解决了这个问题:

  • 首先,我下载llvmlite的最新版本
  • 然后运行以下命令:
pip安装llvmlite-0.35.0-cp39-cp39-win_amd64.whl

  • 接下来,对于librosa需要的所有软件包,我将按如下方式安装它们:
pip安装--无deps packageName

  • 或仅为获取更多样本,请执行以下操作:
pip安装librosa——忽略已安装的llvmlite