I want to utilize the ns-3 visualizer in my project, but I prefer not to rely on the command-line option --vis (Actually I cannot because I use my own CMake instead of ./ns3). Could you please guide me on how to enable and configure ns-3 visualizer functionality in C++? Is there a way to directly enable visualization in the code instead of using a command-line option?
Thank you for your assistance!
$ sudo apt install gir1.2-goocanvas-2.0 python3-gi python3-gi-cairo python3-pygraphviz gir1.2-gtk-3.0 ipython3
2. I try to enable the python-binding and visualizer, but found out there is no this option in ./ns3, so I modified CMakeList.txt to make it on.
line 88 "option(NS3_VISUALIZER "Build visualizer module" ON)"
3. I configure, $ ./ns3 configure, and the output says both python-binding and visualizer are already on. Then I build: $ ./ns3 build all successful
4. Then I try to run the first example with visualizer: $ /ns3 run first --vis. This has error "ns3::VisualSimulatorImpl not found"
5. I realize maybe that's because I haven't installed the pyviz, and all I did was only installing prerequisites for it.
So I $ pip install pyviz, and it has more problem:
Collecting matplotlib==3.0.3 (from pyviz)
Using cached matplotlib-3.0.3.tar.gz (36.6 MB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [61 lines of output]
/tmp/pip-install-xd2dcv5u/matplotlib_536aeddc0db54185b330a0512b60cb91/setup.py:33: SetuptoolsDeprecationWarning: The test command is disabled and references to it are deprecated.
!!
********************************************************************************
Please remove any references to `setuptools.command.test` in all supported versions of the affected package.
By 2024-Nov-15, you need to update your project and remove deprecated calls
or your builds will no longer be supported.
********************************************************************************
!!
from setuptools.command.test import test as TestCommand
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-xd2dcv5u/matplotlib_536aeddc0db54185b330a0512b60cb91/setup.py", line 225, in <module>
msg = pkg.install_help_msg()
File "/tmp/pip-install-xd2dcv5u/matplotlib_536aeddc0db54185b330a0512b60cb91/setupext.py", line 650, in install_help_msg
release = platform.linux_distribution()[0].lower()
AttributeError: module 'platform' has no attribute 'linux_distribution'
============================================================================
Edit setup.cfg to change the build options
6. I googled and found this, saying that the pyviz latest release is in 2019 and it needs matplotlib-3.03 (also 2019), and it works with python3.5
but after python3.8 things changed, so it dont fit anymore.
https://discuss.python.org/t/unable-to-install-pyviz/43284,
Could you please help?
--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/9pHtWvmQaV0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/64ccd4ef-77a1-4a3b-bf0f-9b3d85bb999an%40googlegroups.com.