本文介绍了构建gem5.opt时,出现"ImportError:没有名为六个模块"的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我是gem5的新手.甚至是计算机体系结构的新手.我正在尝试使用scons build/X86/gem5.opt构建gem5.opt,但我收到模块6的导入错误:

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重新安装六个模块,
  • 降级的urlib3版本,
  • 也重新克隆了仓库. (删除上一个课程)
    • 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)
    • 推荐答案

      更新: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 six而不是import six.py.

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

      当前的上游主机执行正确的操作: 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'来找到固定提交,但没有结果,所以我想知道:您是否在干净的树上使用mainline 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:没有名为六个模块"的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

      1403页,肝出来的..

09-06 08:53