在使用pip install onnx时遇到如下错误:

Building wheels for collected packages: onnx
Building wheel for onnx (setup.py) … error
ERROR: Command errored out with exit status 1:
command: /home/users/yuxuan.wei/env/env1/bin/python -u -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-t2jk_rl6/onnx_460e3fe0fd4241829e6bd153039e173b/setup.py’“'”‘; file=’“'”‘/tmp/pip-install-t2jk_rl6/onnx_460e3fe0fd4241829e6bd153039e173b/setup.py’“'”‘;f = getattr(tokenize, ‘"’“‘open’”’“‘, open)(file) if os.path.exists(file) else io.StringIO(’”‘“‘from setuptools import setup; setup()’”’“‘);code = f.read().replace(’”‘"’\r\n’“'”‘, ‘"’"’\n’“'”‘);f.close();exec(compile(code, file, ‘"’“‘exec’”’"‘))’ bdist_wheel -d /tmp/pip-wheel-foccssk2

一堆提示,提炼定位到ERROR: Command errored out with exit status 1:,安装包的版本和Python版本不匹配的报错,如何解决呢?

使用命令查看Python版本:

python -V

加粗样式
Python装包网站上去搜对应包的版本即可,例子如下:
在这里插入图片描述

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐