简体   繁体   中英

gem5 “ImportError: No module named six” even though module six is installed

I'm trying to run a simple system in gem5[SHA: 332a9de33db603e0aefedae1e05134db4257ea3e ] from this Link . It shows following error:

File "< string>", line 1, in < module>

File "build/X86/python/importer.py", line 81, in load_module

exec(code, mod. dict )

File "build/X86/python/m5/ init .py", line 46, in < module>

from. import SimObject File "build/X86/python/importer.py", line 81, in load_module

exec(code, mod. dict )

File "build/X86/python/m5/SimObject.py", line 43, in < module>

from six import add_metaclass

ImportError: No module named six

But I have module six installed and it is successfully used when I run gem5 build . Also I cloud import six from other python IDE and command line without any issue.

I'm using Ubuntu 20.04 and x86_64 architecture.

I have found similar post but here module six could not be detected during gem5.opt build. But my case gem5.opt build successfully found module six and complete operation. But do not found module six when trying to run simple.py system.

I have reinstalled module six, rebuild gem5.opt and even delete all files related to gem5 and clone it again. I have also tried this outside my virtual environment.

This issue is caused during gem5.opt build. As I was willing to use python3 from now on for gem5 as they announce python3 support. So, I use python3 for scons to gem5.opt build and it was successful. But when I tried to run first system script simple.py, import error occurs. My thought scons configuration file miss-configure something in gem5.opt file during build while it uses python3.

I have rebuild gem5.opt using python2.7 and now problem is solved. Even I could use python3 to run "build/X86/gem5.opt config/tutorial/simple.py" and it works fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM