When building gem5.opt, I get 'ImportError: no module named six'

我的未来我决定 提交于 2020-06-28 01:51:27

问题


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

  • I have tried reinstalling python using pacman,
  • Tried reinstalling the module six using pip,
  • downgraded urlib3 version,
  • recloned the repo too. (deleting the previous one ofcourse)

回答1:


Update: OP confirmed in comments that it was a Python 2 vs Python 3 problem, the python 2 package was:

python2-six

Previous answer: The problem is likely that it should be import six instead of import six.py.

The current upstream master does the right thing: https://github.com/gem5/gem5/blob/526a2fb619f5e5c2c2a7f19498a737571df189b7/src/python/m5/util/smartdict.py#L46

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?

Please always provide your gem5 git SHA when asking gem5 questions.



来源:https://stackoverflow.com/questions/56216358/when-building-gem5-opt-i-get-importerror-no-module-named-six

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!