我无法构建gem5,当我构建gem5时,终端显示“需要嵌入式python库3.6或更高版本,找到2.7.17。”。但是,当我检查我的python版本时,我发现我的python版本是3.6。
python --version
Python 3.6.7
最佳答案
gem5 构建环境不使用您的用户环境。这意味着不会设置 PATH 和其他环境变量的自定义值。我的直觉是你的 Python 3 安装是由你的自定义值之一指向的。如果没有这些,gem5 使用 Python 系统安装,在您的情况下是 Python 2。
官方文档中有针对您的情况的部分和修复:Python in a non-default location 。本质上,您应该通过 python3
可执行文件运行 SCons:
python3 `which scons` build/X86/gem5.opt
如果您的 python3-config
可执行文件在系统路径中不可用,您还应该通过 PYTHON_CONFIG 构建变量传递它:
python3 `which scons` PYTHON_CONFIG=python3-config build/X86/gem5.opt
关于python - gem5 构建失败并显示 "Embedded python library 3.6 or newer required, found 2.7.17.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69156362/