I am using ns-3.36.1 on Ubuntu 22.04.1 .
I have used this command to copy first.py into scratch folder :
ali@ali-virtual-machine:~/ns-allinone-3.36.1/ns-3.36.1 $ cp examples/tutorial/first.py scratch/myfirst.py
and I have used this command to run it
ali@ali-virtual-machine:~/ns-allinone-3.36.1/ns-3.36.1 $ ./ns3 build
ali@ali-virtual-machine:~/ns-allinone-3.36.1/ns-3.36.1 $ ./ns3 run scratch/myfirst.py
But, I always get this following error:
0/2] Re-checking globbed directories...
ninja: no work to do.
Traceback (most recent call last):
File "/home/ali/ns-allinone-3.36.1/ns-3.36.1/scratch/myfirst.py", line 16, in <module>
import ns.applications
ModuleNotFoundError: No module named 'ns.applications'; 'ns' is not a package
Command 'python3 scratch/myfirst.py' returned non-zero exit status 1.
After running $ ./ns3 build, I found Python Bindings is OFF in my system.
According to my research, my mentioned problem might be caused by Python Bindings being OFF.
However, I do not know how to turn it on.
It would be greatly appreciated if you could assist me.
Thanks in advance.