简体   繁体   中英

how to run python file on mininet

/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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM