无法在Python中安装lap==0.4.0库。

huangapple go评论136阅读模式
英文:

unable to install lap==0.4.0 library in python

问题

我试图安装用于目标检测的LAP,但无法成功。

我尝试在Python版本9、10和11上安装它,但都无法成功。

我正在从Murtaza的工作坊 - 机器人和人工智能中学习目标检测。

或者有没有办法解决这个问题?

错误信息如下:

  1. 收集 lap==0.4.0
  2. 使用缓存的 lap-0.4.0.tar.gz (1.5 MB)
  3. 准备元数据 (setup.py): 开始
  4. 准备元数据 (setup.py): 完成,状态为 'done'
  5. 构建 lap wheel
  6. 构建 lap wheel (setup.py): 开始
  7. 构建 lap wheel (setup.py): 完成,状态为 'error'
  8. 运行 setup.py clean for lap
  9. 无法构建 lap
  10. 正在安装已收集的软件包:lap
  11. 运行 setup.py install for lap: 开始
  12. 运行 setup.py install for lap: 完成,状态为 'error'
  13. 错误:subprocess-exited-with-error
  14. python setup.py bdist_wheel 未成功运行。
  15. 退出代码:1
  16. [输出的 39 行内容]
  17. 在构建过程中部分导入 lap
  18. C:\Users\ACER\AppData\Local\Temp\pip-install-a82najcq\lap_e14dabff97d544e59d3633db1f44d15e\setup.py:223: DeprecationWarning:
  19. `numpy.distutils` NumPy 1.23.0 起已不再推荐使用,因为 `distutils` 本身已不再推荐使用。对于 Python >= 3.12,它将被删除。对于较旧的 Python 版本,它将继续存在。建议对于这些 Python 版本使用 `setuptools < 60.0`
  20. 有关更多详细信息,请参阅:
  21. https://numpy.org/devdocs/reference/distutils_status_migration.html
  22. from numpy.distutils.core import setup
  23. 生成 cython 文件
  24. 运行 bdist_wheel
  25. 运行 build
  26. 运行 config_cc
  27. INFO: unifing config_cc, config, build_clib, build_ext, build commands --compiler options
  28. 运行 config_fc
  29. INFO: unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
  30. 运行 build_src
  31. INFO: build_src
  32. INFO: 正在构建扩展 "lap._lapjv" 的源代码
  33. INFO: 正在构建 data_files 源代码
  34. INFO: build_src: 正在构建 npy-pkg 配置文件
  35. 运行 build_py
  36. 创建 build
  37. 创建 build\lib.win-amd64-cpython-39
  38. 创建 build\lib.win-amd64-cpython-39\lap
  39. 复制 lap\lapmod.py -> build\lib.win-amd64-cpython-39\lap
  40. 复制 lap\__init__.py -> build\lib.win-amd64-cpython-39\lap
  41. 运行 build_ext
  42. INFO: numpy.distutils._msvccompiler 模块中没有名为 'numpy.distutils._msvccompiler' 的模块;尝试从 distutils 中导入
  43. INFO: 定制 MSVCCompiler
  44. INFO: 使用 build_ext 定制 MSVCCompiler
  45. INFO: CCompilerOpt.cc_test_flags[1077] : 测试标志 (/O2)
  46. 错误:需要 Microsoft Visual C++ 14.0 或更高版本。请使用 "Microsoft C++ Build Tools" 获取它:https://visualstudio.microsoft.com/visual-cpp-build-tools/
  47. INFO: CCompilerOpt.cache_flush[857] : 将缓存写入路径 -> C:\Users\ACER\AppData\Local\Temp\pip-install-a82najcq\lap_e14dabff97d544e59d3633db1f44d15e\build\temp.win-amd64-cpython-39\Release\ccompiler_opt_cache_ext.py
  48. [输出的 39 行内容]
  49. 注意:此错误源自子进程,可能与 pip 无关。
  50. 错误:lap 构建 wheel 时失败
  51. 错误:subprocess-exited-with-error
  52. 运行 setup.py install for lap 未成功运行。
  53. 退出代码:1
  54. [输出的 39 行内容]
  55. 在构建过程中部分导入 lap
  56. C:\Users\ACER\AppData\Local\Temp\pip-install-a82najcq\lap_e14dabff97d544e59d3633db1f44d15e\setup.py:223: DeprecationWarning:
  57. `numpy.distutils` NumPy 1.23.0 起已不再推荐使用,因为 `distutils` 本身已不再推荐使用。对于 Python >= 3.12,它将被删除。对于较旧的 Python 版本,它将继续存在。建议对于这些 Python 版本使用 `setuptools < 60.0`
  58. 有关更多详细信息,请参阅:
  59. https://numpy.org/devdocs/reference/distutils_status_migration.html
  60. from numpy.distutils.core import setup
  61. 生成 cython 文件
  62. 运行 install
  63. 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.
  64. warnings.warn(
  65. 运行 build
  66. 运行 config_cc
  67. INFO: unifing config_cc, config, build_clib, build_ext, build commands --compiler options
  68. 运行 config_fc
  69. INFO: unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
  70. 运行 build_src
  71. INFO: build_src
  72. INFO: 正在构建扩展 "lap._lapjv" 的源代码
  73. INFO: 正在构建 data_files 源代码
  74. INFO: build_src: 正在构建 npy-pkg 配置文件
  75. 运行 build_py
  76. 创建 build
  77. 创建 build\lib.win-amd64-cpython-39
  78. 创建 build\lib.win-amd64-cpython-39\lap
  79. 复制 lap\lapmod.py -> build\lib.win-amd64-cpython-39\lap
  80. 复制 lap\__init__.py -> build\lib.win-amd64-cpython-39\lap
  81. 运行 build_ext
  82. INFO: numpy.distutils._msvccompiler 模块中没有名为 'numpy.distutils._msvccompiler' 的模块;尝试从 distutils 中导入
  83. INFO: 定制 MSVCCompiler
  84. INFO: 使用 build_ext 定制 MSVCCompiler
  85. INFO: CCompilerOpt.cc_test_flags[
  86. <details>
  87. <summary>英文:</summary>
  88. I was trying to install lap for object detection but i cloud not do it.
  89. I have try to installed it on python version 9 , 10 and 11 also but i cant do it
  90. I am learning object detection from
  91. Murtaza&#39;s Workshop - Robotics and AI.
  92. or is there any way to fix this problem
  93. C:\\Users\\ACER\\Desktop\\Object-Detection-Yolo\\venv39\\Scripts\\activate.bat
  94. pip install lap==0.4.0
  95. the error:

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:

  1. `numpy.distutils` is deprecated since NumPy 1.23.0, as a result
  2. of the deprecation of `distutils` itself. It will be removed for
  3. Python &gt;= 3.12. For older Python versions it will remain present.
  4. It is recommended to use `setuptools &lt; 60.0` for those Python versions.
  5. For more details, see:
  6. https://numpy.org/devdocs/reference/distutils_status_migration.html
  7. 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:

  1. `numpy.distutils` is deprecated since NumPy 1.23.0, as a result
  2. of the deprecation of `distutils` itself. It will be removed for
  3. Python &gt;= 3.12. For older Python versions it will remain present.
  4. It is recommended to use `setuptools &lt; 60.0` for those Python versions.
  5. For more details, see:
  6. https://numpy.org/devdocs/reference/distutils_status_migration.html
  7. 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

  1. </details>
  2. # 答案1
  3. **得分**: 1
  4. 安装适合您计算机版本的 Microsoft Visual C++ Build Tools。这可能有助于解决问题并升级 "pip"。
  5. 链接:https://visualstudio.microsoft.com/visual-cpp-build-tools/
  6. 然后运行以下命令升级 "pip":
  7. ```python -m pip install --upgrade pip```
  8. 之后,再尝试安装 lap 版本 0.4.0:
  9. ```pip install lap==0.4.0```
  10. <details>
  11. <summary>英文:</summary>
  12. Install Microsoft Visual C++ Build Tools with appropriate version for your computer. This might help about this and upgrade &quot;pip&quot;
  13. ```https://visualstudio.microsoft.com/visual-cpp-build-tools/```
  14. ```python -m pip install --upgrade pip```
  15. and after this, try again with:
  16. ```pip install lap==0.4.0```
  17. </details>

huangapple
  • 本文由 发表于 2023年6月13日 17:55:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/76463707.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定