Reputation: 390
I'm new to the ns3, and I was trying to integrate ns3 to PyCharm cause I'm familiar with PyCharm. It seems that ns3 is installed correctly on my machine, running ./waf python works fine but when I use ./waf shell, there are some modules it couldn't find, such as ns.application...etc. So, when I try the solution on this page: add waf libraries to PyCharm, it doesn't work too. Could anyone help me to solve this issue? I would really really appreciate it. By the way, the file I test was the sample from ns3: ns3_root/source/example/tutorial/first.py.
Upvotes: 0
Views: 287
Reputation: 126
If you have enabled the python bindings and have built them, you need to add the ns3_root/build/bindings/python to the environment variable PYTHONPATH. After that running first.py should work.
You can do that running
export PYTHONPATH=$PYTHONPATH:/path/to/ns3_root/build/bindings/python
Or select first.py, edit the target settings and add that environment variable.
Or if you want this to persist, add this line to the end of the ~/. bashrc
file.
Upvotes: 0