问题
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