问题描述
我是 gem5 的新手.甚至对计算机体系结构来说都是新的.我正在尝试使用 scons build/X86/gem5.opt
构建 gem5.opt 我收到模块六的导入错误:
I'm new to gem5. New even to computer architecture. I am trying to build the gem5.opt using scons build/X86/gem5.opt
I get an import error for module six:
➜ gem5 scons build/RISCV/gem5.opt
scons: Reading SConscript files ...
ImportError: No module named six.py:
File "/home/hari/gem5/SConstruct", line 102:
from m5.util import compareVersions, readCommand
File "/home/hari/gem5/src/python/m5/util/__init__.py", line 54:
from .smartdict import SmartDict
File "/home/hari/gem5/src/python/m5/util/smartdict.py", line 46:
import six.py
- 我尝试使用 pacman 重新安装 python,
- 尝试使用 pip 重新安装模块 6,
- 降级的 urlib3 版本,
- 也重新克隆了存储库.(当然删除前一个)
推荐答案
更新:OP 在评论中确认这是 Python 2 vs Python 3 问题,python 2 包是:
Update: OP confirmed in comments that it was a Python 2 vs Python 3 problem, the python 2 package was:
python2-six
上一个回答:问题很可能应该是import六
而不是import Six.py
.
Previous answer: The problem is likely that it should be import six
instead of import six.py
.
当前的上游 master 做了正确的事情:https://github.com/gem5/gem5/blob/526a2fb619f5e5c2c2a7f19498a737571df189b7/src/python/m5/util/smartdict.py#L46
The current upstream master does the right thing: https://github.com/gem5/gem5/blob/526a2fb619f5e5c2c2a7f19498a737571df189b7/src/python/m5/util/smartdict.py#L46
我也尝试了 git log -p -G 'sys\.py'
来查找修复提交,但没有结果,所以我想知道:你是否在干净的树上使用主线 gem5?
Also I tried git log -p -G 'sys\.py'
to find a fixing commit, but no results, so I wonder: are you using mainline gem5 on a clean tree?
在询问 gem5 问题时,请始终提供您的 gem5 git SHA.
Please always provide your gem5 git SHA when asking gem5 questions.
这篇关于在构建 gem5.opt 时,我收到“ImportError: no module named Six"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!