pip install lap报错:
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [52 lines of output]
C:\Users\10129\AppData\Local\Temp\pip-install-di20nqd0\lap_5ceb859f8b6e4225841f855446d3be35\setup.py:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import parse_version
Partial import of lap during the build process.
C:\Users\10129\AppData\Local\Temp\pip-install-di20nqd0\lap_5ceb859f8b6e4225841f855446d3be35\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
D:\anaconda\envs\py\lib\site-packages\setuptools\_distutils\cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!
********************************************************************************
Please avoid running ``setup.py`` directly.
Instead, use pypa/build, pypa/installer or other
standards-based tools.
See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
********************************************************************************
!!
self.initialize_options()
running build_py
creating build
creating build\lib.win-amd64-cpython-39
creating build\lib.win-amd64-cpython-39\lap
copying lap\lapmod.py -> build\lib.win-amd64-cpython-39\lap
copying lap\__init__.py -> build\lib.win-amd64-cpython-39\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)
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
INFO: CCompilerOpt.cache_flush[864] : write cache to path -> C:\Users\10129\AppData\Local\Temp\pip-install-di20nqd0\lap_5ceb859f8b6e4225841f855446d3be35\build\temp.win-amd64-cpython-39\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: Could not build wheels for lap, which is required to install pyproject.toml-based projects
解决方法:python3.9以下:pip install git+git://github.com/gatagat/lap.git或conda install -c conda-forge lap
其他:pip install lapx