安装paddlex2.1报错:lap编译不成功解决方法

安装paddlex2.1报错:lap编译不成功解决方法

报错描述:

Building wheels for collected packages: lap
  Building wheel for lap (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [128 lines of output]
      Partial import of lap during the build process.
      C:\Users\tayo\AppData\Local\Temp\pip-install-8slv0nli\lap_cb6b5baee0624d29a9045428ca82ec34\setup.py:223: DeprecationWarning:

        `numpy.distutils` is deprecated since NumPy 1.23.0, as a result
        of the deprecation of `distutils` itself. It will be removed for
        Python >= 3.12. For older Python versions it will remain present.
        It is recommended to use `setuptools < 60.0` for those Python versions.
        For more details, see:
          https://numpy.org/devdocs/reference/distutils_status_migration.html


        from numpy.distutils.core import setup
      Generating cython files
      running bdist_wheel
      running build
      running config_cc
      INFO: unifing config_cc, config, build_clib, build_ext, build commands --compiler options
      running config_fc
      INFO: unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
      running build_src
      INFO: build_src
      INFO: building extension "lap._lapjv" sources
      INFO: building data_files sources
      INFO: build_src: building npy-pkg config files
      C:\Users\tayo\.conda\envs\paddleGPU\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build_py
      creating build
      creating build\lib.win-amd64-3.9
      creating build\lib.win-amd64-3.9\lap
      copying lap\lapmod.py -> build\lib.win-amd64-3.9\lap
      copying lap\__init__.py -> build\lib.win-amd64-3.9\lap
      running build_ext
      INFO: No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      INFO: customize MSVCCompiler
      INFO: customize MSVCCompiler using build_ext
      INFO: CCompilerOpt.cc_test_flags[1086] : testing flags (/O2)
      creating C:\Users\tayo\AppData\Local\Temp\tmpfl29wotd\Users
      creating C:\Users\tayo\AppData\Local\Temp\tmpfl29wotd\Users\tayo
      creating C:\Users\tayo\AppData\Local\Temp\tmpfl29wotd\Users\tayo\.conda
      creating C:\Users\tayo\AppData\Local\Temp\tmpfl29wotd\Users\tayo\.conda\envs
      creating C:\Users\tayo\AppData\Local\Temp\tmpfl29wotd\Users\tayo\.conda\envs\paddleGPU
      creating C:\Users\tayo\AppData\Local\Temp\tmpfl29wotd\Users\tayo\.conda\envs\paddleGPU\Lib
      creating C:\Users\tayo\AppData\Local\Temp\tmpfl29wotd\Users\tayo\.conda\envs\paddleGPU\Lib\site-packages
      creating C:\Users\tayo\AppData\Local\Temp\tmpfl29wotd\Users\tayo\.conda\envs\paddleGPU\Lib\site-packages\numpy
      creating C:\Users\tayo\AppData\Local\Temp\tmpfl29wotd\Users\tayo\.conda\envs\paddleGPU\Lib\site-packages\numpy\distutils
      creating C:\Users\tayo\AppData\Local\Temp\tmpfl29wotd\Users\tayo\.conda\envs\paddleGPU\Lib\site-packages\numpy\distutils\checks
      INFO: CCompilerOpt.cc_test_flags[1086] : testing flags (/WX)
      WARN: CCompilerOpt.__init__[1253] : feature 'AVX512_KNL' is disabled, MSVC compiler doesn't support it
      WARN: CCompilerOpt.__init__[1253] : feature 'AVX512_KNM' is disabled, MSVC compiler doesn't support it
      WARN: CCompilerOpt.__init__[1253] : feature 'AVX512_SPR' is disabled, MSVC compiler doesn't support it
      INFO: CCompilerOpt.__init__[1795] : check requested baseline
      INFO: CCompilerOpt.feature_test[1560] : testing feature 'SSE' with flags ()
      INFO: CCompilerOpt.feature_test[1560] : testing feature 'SSE2' with flags ()
      INFO: CCompilerOpt.feature_test[1560] : testing feature 'SSE3' with flags ()
      INFO: CCompilerOpt.__init__[1804] : check requested dispatch-able features
      INFO: CCompilerOpt.cc_test_flags[1086] : testing flags (/arch:AVX)
      INFO: CCompilerOpt.cc_test_flags[1086] : testing flags (/arch:AVX2)
      INFO: CCompilerOpt.cc_test_flags[1086] : testing flags (/arch:AVX512)
      INFO: CCompilerOpt.feature_test[1560] : testing feature 'AVX512CD' with flags (/arch:AVX512)
      INFO: CCompilerOpt.feature_test[1560] : testing feature 'SSE42' with flags ()
      INFO: CCompilerOpt.feature_test[1560] : testing feature 'FMA3' with flags (/arch:AVX2)
      INFO: CCompilerOpt.feature_test[1560] : testing feature 'AVX512_SKX' with flags (/arch:AVX512)
      INFO: CCompilerOpt.feature_test[1560] : testing feature 'POPCNT' with flags ()
      INFO: CCompilerOpt.feature_test[1560] : testing feature 'F16C' with flags (/arch:AVX)
      INFO: CCompilerOpt.feature_test[1560] : testing feature 'SSE41' with flags ()
      INFO: CCompilerOpt.feature_test[1560] : testing feature 'AVX' with flags (/arch:AVX)
      INFO: CCompilerOpt.feature_test[1560] : testing feature 'SSSE3' with flags ()
      INFO: CCompilerOpt.feature_test[1560] : testing feature 'AVX2' with flags (/arch:AVX2)
      INFO: CCompilerOpt.feature_test[1560] : testing feature 'AVX512F' with flags (/arch:AVX512)
      INFO: CCompilerOpt.feature_test[1560] : testing feature 'AVX512_CLX' with flags (/arch:AVX512)
      INFO: CCompilerOpt.feature_test[1560] : testing feature 'AVX512_CNL' with flags (/arch:AVX512)
      INFO: CCompilerOpt.feature_test[1560] : testing feature 'AVX512_ICL' with flags (/arch:AVX512)
      INFO: CCompilerOpt.__init__[1816] : skip features (SSE SSE3 SSE2) since its part of baseline
      INFO: CCompilerOpt.__init__[1820] : initialize targets groups
      INFO: CCompilerOpt.__init__[1822] : parse target group simd_test
      INFO: CCompilerOpt._parse_target_tokens[2033] : skip targets (VSX2 ASIMD FMA4 VXE2 VSX3 XOP VX VSX NEON VSX4 VXE) not part of baseline or dispatch-able features
      INFO: CCompilerOpt._parse_policy_not_keepbase[2145] : skip baseline features (SSE2)
      INFO: CCompilerOpt.generate_dispatch_header[2366] : generate CPU dispatch header: (build\src.win-amd64-3.9\numpy\distutils\include\npy_cpu_dispatch_config.h)
      WARN: CCompilerOpt.generate_dispatch_header[2375] : dispatch header dir build\src.win-amd64-3.9\numpy\distutils\include does not exist, creating it
      INFO: CCompilerOpt.feature_extra_checks[1640] : Testing extra checks for feature 'AVX512F' (AVX512F_REDUCE)
      INFO: CCompilerOpt.feature_extra_checks[1640] : Testing extra checks for feature 'AVX512_SKX' (AVX512BW_MASK AVX512DQ_MASK)
      INFO: No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
      INFO: customize MSVCCompiler
      WARN: Missing compiler_cxx fix for MSVCCompiler
      INFO: customize MSVCCompiler using build_ext
      INFO: building 'lap._lapjv' extension
      INFO: compiling C sources
      creating build\temp.win-amd64-3.9\Release\lap
      INFO: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\bin\HostX86\x64\cl.exe /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\tayo\.conda\envs\paddleGPU\lib\site-packages\numpy\_core\include -Ilap -IC:\Users\tayo\.conda\envs\paddleGPU\lib\site-packages\numpy\_core\include -Ibuild\src.win-amd64-3.9\numpy\distutils\include -IC:\Users\tayo\.conda\envs\paddleGPU\include -IC:\Users\tayo\.conda\envs\paddleGPU\Include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\ATLMFC\include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.26100.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\um -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\shared -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\winrt -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\cppwinrt -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um /EHsc /Tplap\_lapjv.cpp /Fobuild\temp.win-amd64-3.9\Release\lap\_lapjv.obj /Zm1000
      _lapjv.cpp
      C:\Users\tayo\.conda\envs\paddleGPU\lib\site-packages\numpy\_core\include\numpy\npy_1_7_deprecated_api.h(14) : Warning Msg: Using deprecated NumPy API, disable it with #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
      lap\_lapjv.cpp(2103): warning C4244:=: 从“npy_intp”转换到“int”,可能丢失数据
      lap\_lapjv.cpp(2789): warning C4244:=: 从“npy_intp”转换到“uint_t”,可能丢失数据
      lap\_lapjv.cpp(5068): error C2039: "subarray": 不是 "_PyArray_Descr" 的成员
      C:\Users\tayo\.conda\envs\paddleGPU\lib\site-packages\numpy\_core\include\numpy\ndarraytypes.h(618): note: 参见“_PyArray_Descr”的声明
      lap\_lapjv.cpp(5069): error C2039: "subarray": 不是 "_PyArray_Descr" 的成员
      C:\Users\tayo\.conda\envs\paddleGPU\lib\site-packages\numpy\_core\include\numpy\ndarraytypes.h(618): note: 参见“_PyArray_Descr”的声明
      lap\_lapjv.cpp(5164): error C2039: "names": 不是 "_PyArray_Descr" 的成员
      C:\Users\tayo\.conda\envs\paddleGPU\lib\site-packages\numpy\_core\include\numpy\ndarraytypes.h(618): note: 参见“_PyArray_Descr”的声明
      lap\_lapjv.cpp(5168): error C2039: "names": 不是 "_PyArray_Descr" 的成员
      C:\Users\tayo\.conda\envs\paddleGPU\lib\site-packages\numpy\_core\include\numpy\ndarraytypes.h(618): note: 参见“_PyArray_Descr”的声明
      lap\_lapjv.cpp(5187): error C2039: "fields": 不是 "_PyArray_Descr" 的成员
      C:\Users\tayo\.conda\envs\paddleGPU\lib\site-packages\numpy\_core\include\numpy\ndarraytypes.h(618): note: 参见“_PyArray_Descr”的声明
      lap\_lapjv.cpp(5191): error C2039: "fields": 不是 "_PyArray_Descr" 的成员
      C:\Users\tayo\.conda\envs\paddleGPU\lib\site-packages\numpy\_core\include\numpy\ndarraytypes.h(618): note: 参见“_PyArray_Descr”的声明
      lap\_lapjv.cpp(5392): error C2039: "elsize": 不是 "_PyArray_Descr" 的成员
      C:\Users\tayo\.conda\envs\paddleGPU\lib\site-packages\numpy\_core\include\numpy\ndarraytypes.h(618): note: 参见“_PyArray_Descr”的声明
      lap\_lapjv.cpp(7255): warning C4996: '_PyUnicode_get_wstr_length': deprecated in 3.3
      lap\_lapjv.cpp(7271): warning C4996: '_PyUnicode_get_wstr_length': deprecated in 3.3
      error: Command "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\bin\HostX86\x64\cl.exe /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\tayo\.conda\envs\paddleGPU\lib\site-packages\numpy\_core\include -Ilap -IC:\Users\tayo\.conda\envs\paddleGPU\lib\site-packages\numpy\_core\include -Ibuild\src.win-amd64-3.9\numpy\distutils\include -IC:\Users\tayo\.conda\envs\paddleGPU\include -IC:\Users\tayo\.conda\envs\paddleGPU\Include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\ATLMFC\include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.26100.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\um -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\shared -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\winrt -IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\cppwinrt -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um /EHsc /Tplap\_lapjv.cpp /Fobuild\temp.win-amd64-3.9\Release\lap\_lapjv.obj /Zm1000" failed with exit status 2
      INFO:
      ########### EXT COMPILER OPTIMIZATION ###########
      INFO: Platform      :
        Architecture: x64
        Compiler    : msvc

      CPU baseline  :
        Requested   : 'min'
        Enabled     : SSE SSE2 SSE3
        Flags       : none
        Extra checks: none

      CPU dispatch  :
        Requested   : 'max -xop -fma4'
        Enabled     : SSSE3 SSE41 POPCNT SSE42 AVX F16C FMA3 AVX2 AVX512F AVX512CD AVX512_SKX AVX512_CLX AVX512_CNL AVX512_ICL
        Generated   : none
      INFO: CCompilerOpt.cache_flush[864] : write cache to path -> C:\Users\tayo\AppData\Local\Temp\pip-install-8slv0nli\lap_cb6b5baee0624d29a9045428ca82ec34\build\temp.win-amd64-3.9\Release\ccompiler_opt_cache_ext.py
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for lap
  Running setup.py clean for lap
Failed to build lap
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (lap)

解决方法:

1、github网址下载lap包进行编译:
按照上面的方法本地事先编译好就行。

https://github.com/gatagat/lap
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值