NS-3 ImportError: No module named cflags

NS-3 ImportError: No module named cflags

我正在尝试 运行 在 Ubuntu 18.04 中使用 ./waf 编译和构建 NS-3 项目,但我收到以下错误消息:

Waf: The wscript in '/home/user/workspace/ns3-802.11ad' is unreadable
Traceback (most recent call last):
  File "/home/user/workspace/ns3-802.11ad/.waf-1.8.19-b1fc8f7baef51bd2db4c2971909a568d/waflib/Scripting.py", line 100, in waf_entry_point
    set_main_module(os.path.normpath(os.path.join(Context.run_dir,Context.WSCRIPT_FILE)))
  File "/home/user/workspace/ns3-802.11ad/.waf-1.8.19-b1fc8f7baef51bd2db4c2971909a568d/waflib/Scripting.py", line 125, in set_main_module
    Context.g_module=Context.load_module(file_path)
  File "/home/user/workspace/ns3-802.11ad/.waf-1.8.19-b1fc8f7baef51bd2db4c2971909a568d/waflib/Context.py", line 354, in load_module
    try:exec(compile(code,path,'exec'),module.__dict__)
  File "/home/user/workspace/ns3-802.11ad/wscript", line 53, in <module>
    import cflags # override the build profiles from waf
ImportError: No module named cflags

有人能帮帮我吗?

在我看来,您的下载似乎以某种方式损坏了。 再试一次,并检查以下内容是否成立:

arshad@a4arshad:~/Downloads$ md5sum ns-allinone-3.29.tar.bz2 
1f4b667035fdb79471c7319f38595289  ns-allinone-3.29.tar.bz2
arshad@a4arshad:~/Downloads$ ls -l ns-allinone-3.29
total 36
drwxr-xr-x  6 arshad arshad 4096 Mar 30 16:57 bake
-rwxr-xr-x  1 arshad arshad 5940 Sep  5  2018 build.py
-rw-r--r--  1 arshad arshad  575 Sep  5  2018 constants.py
drwxr-xr-x  3 arshad arshad 4096 Mar 30 16:57 netanim-3.108
drwxr-xr-x 10 arshad arshad 4096 Mar 30 16:57 ns-3.29
drwxr-xr-x 10 arshad arshad 4096 Mar 30 16:57 pybindgen-0.17.0.post58+ngcf00cc0
-rw-r--r--  1 arshad arshad  924 Sep  5  2018 README
-rw-r--r--  1 arshad arshad  561 Sep  5  2018 util.py

或者你可以试试这个:

./waf distclean
./waf configure
./waf