Open deegopi opened 8 years ago
Same problem here .... how and where to include mininet.topo package to python? The below code could not find mininet.topo package. from mininet.topo import Topo
Make sure you are running mininet as root.
The mininet installer from the repo installs to /usr/local/lib
which is not in PYTHONPATH, found it with find /usr/local -name "*mininet*"
. So, I started Python with
sudo PYTONPATH=/usr/local/lib/python2.7/dist-packages:$PYTHONPATH python
and then import mininet
works.
No more! in 2.3.0d6
student@student-VirtualBox:~/Devel$ sudo PYTHONPATH=/usr/local/lib/python2.7/dist-packages python
Python 2.7.15+ (default, Oct 7 2019, 17:39:04)
[GCC 7.4.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mininet
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "mininet.py", line 4, in <module>
from mininet.topo import Topo
ImportError: No module named topo
Even more:
student@student-VirtualBox:~/Devel$ python
Python 2.7.15+ (default, Oct 7 2019, 17:39:04)
[GCC 7.4.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> print environ['PYTHONPATH']
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'environ' is not defined
>>> print os.environ['PYTHONPATH']
/usr/local/lib/python2.7/dist-packages
So, setting PYTHONPATH in sudo makes little sense
pip install mininet
Hi All,
In my code similar to mininet I have written the import as "from mininext.topo import Topo" and I get the following error Traceback(most recent call last) File "example/16router/start.py" ,line 10 ,in
from mininext.topo import Topo
ImportError: No module named mininext.topo
The similar fashion continues for "from mininext.net import MiniNExT" and "from mininet.net import Mininet"
Please if anyone knows the solution for the above error, kindly post it here.
Thanks for your help!!!