安装'lap'模块时出现'No module named numpy'错误,如何解决?

gz5pxeao  于 2023-06-23  发布在  其他
关注(0)|答案(1)|浏览(763)

我已经检查了所有的条件,也安装了所有必要的模块
这里是错误的文本-

Collecting lap
  Using cached lap-0.4.0.tar.gz (1.5 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [20 lines of output]
      Partial import of lap during the build process.
      Traceback (most recent call last):
        File "<string>", line 127, in get_numpy_status
      ModuleNotFoundError: No module named 'numpy'
      Traceback (most recent call last):
        File "C:\Users\HP\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Users\HP\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "C:\Users\HP\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 149, in prepare_metadata_for_build_wheel
          return hook(metadata_directory, config_settings)
        File "C:\Users\HP\AppData\Local\Temp\pip-build-env-59qch528\overlay\Lib\site-packages\setuptools\build_meta.py", line 380, in prepare_metadata_for_build_wheel
          self.run_setup()
        File "C:\Users\HP\AppData\Local\Temp\pip-build-env-59qch528\overlay\Lib\site-packages\setuptools\build_meta.py", line 487, in run_setup
          super(_BuildMetaLegacyBackend,
        File "C:\Users\HP\AppData\Local\Temp\pip-build-env-59qch528\overlay\Lib\site-packages\setuptools\build_meta.py", line 338, in run_setup
          exec(code, locals())
        File "<string>", line 236, in <module>
        File "<string>", line 220, in setup_package
      ImportError: lap requires numpy, please "pip install numpy".
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
1tu0hz3e

1tu0hz3e1#

当我尝试安装easy_ViTPose要求时,我遇到了同样的问题。我通过从requirements.txt中删除lap解决了这个问题,然后安装了所有带有pip install -r requirements.txt的包。之后我调用了pip install lap==0.4.0,它工作了。

相关问题