how to run python file on mininet

765 views Asked by At
/Desktop/mininet/examples$ sudo python tree1024.py

Error:

Traceback (most recent call last):
  File "tree1024.py", line 10, in <module>
    from mininet.cli import CLI
ModuleNotFoundError: No module named 'mininet'

Whenever I am trying to run python file it is throwing this error. can please some guide how to resolve this.

2

There are 2 answers

0
Giuseppe On

Try to clone Mininet and export the path

cd ~
git clone https://github.com/mininet/mininet.git
cd mininet
export PYTHONPATH=$PYTHONPATH:$HOME/mininet/mininet:

Then run the script with python3

sudo python3 tree1024.py
1
Zohreh Rezaei On

Because the mininet is not fully installed, Try to install it through the clone.