无法在python中安装lap==0.4.0库

问题描述 投票:0回答:2

我试图安装 lap 进行物体检测,但我云没有这样做。

我也尝试在 python 版本 9、10 和 11 上安装它,但我做不到

我正在学习目标检测 Murtaza 的研讨会 - 机器人和人工智能。

或者有什么办法可以解决这个问题

C:\\Users\\ACER\\Desktop\\Object-Detection-Yolo\\venv39\\Scripts\\activate.bat
pip install lap==0.4.0

错误:

Collecting lap==0.4.0
  Using cached lap-0.4.0.tar.gz (1.5 MB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Building wheels for collected packages: lap
  Building wheel for lap (setup.py): started
  Building wheel for lap (setup.py): finished with status 'error'
  Running setup.py clean for lap
Failed to build lap
Installing collected packages: lap
  Running setup.py install for lap: started
  Running setup.py install for lap: finished with status 'error'

  error: subprocess-exited-with-error
  
  python setup.py bdist_wheel did not run successfully.
  exit code: 1
  
  [39 lines of output]
  Partial import of lap during the build process.
  C:\Users\ACER\AppData\Local\Temp\pip-install-a82najcq\lap_e14dabff97d544e59d3633db1f44d15e\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\ACER\Desktop\Object-Detection-Yolo\venv39\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-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[1077] : 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[857] : write cache to path -> C:\Users\ACER\AppData\Local\Temp\pip-install-a82najcq\lap_e14dabff97d544e59d3633db1f44d15e\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
  error: subprocess-exited-with-error
  
  Running setup.py install for lap did not run successfully.
  exit code: 1
  
  [39 lines of output]
  Partial import of lap during the build process.
  C:\Users\ACER\AppData\Local\Temp\pip-install-a82najcq\lap_e14dabff97d544e59d3633db1f44d15e\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 install
  C:\Users\ACER\Desktop\Object-Detection-Yolo\venv39\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
  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
  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[1077] : 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[857] : write cache to path -> C:\Users\ACER\AppData\Local\Temp\pip-install-a82najcq\lap_e14dabff97d544e59d3633db1f44d15e\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: legacy-install-failure

Encountered error while trying to install package.

lap

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

[notice] A new release of pip available: 22.3.1 -> 23.1.2
[notice] To update, run: python.exe -m pip install --upgrade pip
python machine-learning data-science object-detection cvzone
2个回答
1
投票

安装适合您计算机版本的 Microsoft Visual C++ Build Tools。这可能会对此有所帮助并升级“pip”

https://visualstudio.microsoft.com/visual-cpp-build-tools/

python -m pip install --upgrade pip

此后,再试一次:

pip install lap==0.4.0


0
投票

我到底应该安装哪个版本?我试过了,还是不行

© www.soinside.com 2019 - 2024. All rights reserved.