PyViz可视化工具并未被打开,显示缺少依赖,pip安装后不起作用
原因:查看自己是否将所需依赖安装在了conda的环境中(即使是base环境也不行),ns3运行时只会使用Ubuntu系统自己安装的全局Python环境.
解决:
暂时退出conda环境 ,重复conda deactivate命令知道(base)消失
python3 -m pip install --user cppyy 安装需要的cppyy模块
sudo apt install gir1.2-goocanvas-2.0 python3-gi python3-gi-cairo python3-pygraphviz gir1.2-gtk-3.0 ipython3
安装所需依赖
./ns3 configure --build-profile=debug --enable-examples --enable-tests --enable-python-bindings打开python绑定配置,即可发现可视化工具已经启用。
./ns3重新编译后 运行first.cc测试./ns3 run first.cc --vis 结果弹出可视化界面