【问题标题】:Trying to install onnx using pip and it throwing error: metadata-generation-failed尝试使用 pip 安装 onnx 并抛出错误:元数据生成失败
【发布时间】:2022-08-12 17:22:55
【问题描述】:

所以我尝试使用 pip install 安装 onnx。

操作系统:Windows 10 LTSC 内部版本 17763

(我使用 pip install -r | req.txt 中的 onnx 条目安装了 requirements.txt 中的所有软件包\"#onnx>=1.9.0 #ONNX 导出\"但 onnx 不会安装)

我尝试使用以下方法安装它:

  1. 点安装onnx
  2. pip3 安装
  3. pip install onnx>=1.9.0
  4. pip3 安装 onnx>=1.9.0

    在 python 版本上

    1. 3.7.0
    2. 3.10.4
    3. 3.9.something
      • 我尝试下载 onnx : pip download onnx

      每次我得到这个:

      Collecting onnx
        Using cached onnx-1.11.0.tar.gz (9.9 MB)
        Preparing metadata (setup.py) ... error
        error: subprocess-exited-with-error
      
        × python setup.py egg_info did not run successfully.
        │ exit code: 1
        ╰─> [7 lines of output]
            fatal: not a git repository (or any of the parent directories): .git
            Traceback (most recent call last):
              File \"<string>\", line 2, in <module>
              File \"<pip-setuptools-caller>\", line 34, in <module>
              File \"C:\\Users\\Red007Master\\AppData\\Local\\Temp\\pip-download-coisn9j3\\onnx_f49974f8ac4344abaca0eecae41c15e4\\setup.py\", line 86, in <module>
                assert CMAKE, \'Could not find \"cmake\" executable!\'
            AssertionError: Could not find \"cmake\" executable!
            [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.
      

      什么是 \"cmake\" 我可以在哪里得到它以及如何修复它? + 为什么我只需要这个包的“cmake”?

      以及下载/安装我拥有的软件包有什么选择? + 我做错了什么。

    标签: python pip onnx


    【解决方案1】:

    从 cmake.org/download/ 下载(并安装 + 添加到 PATH)CMake 并在 python 版本 3.9.2 上使用新的 venv。

    【讨论】:

      【解决方案2】:

      只需安装 cmake: sudo apt install cmake

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2021-02-16
        • 2020-05-12
        • 2019-11-25
        • 1970-01-01
        • 2020-08-09
        • 2022-01-23
        • 1970-01-01
        • 2022-11-11
        相关资源
        最近更新 更多