我已经在我的计算机上安装了mininet,现在我想用mininet运行一个python脚本。我该怎么做呢?
如果我只使用python3 star.py,我会得到一个错误:
Traceback (most recent call last):
File "star.py", line 2, in <module>
from mininet.cli import CLI
ModuleNotFoundError: No module named 'mininet'如果我尝试使用sudo mn python3 star.py,那么我会得到
Usage: mn [options]
(type mn -h for details)
The mn utility creates Mininet network from the command line. It can create
parametrized topologies, invoke the Mininet CLI, and run tests.
Options:
-h, --help show this help message and exit如果我先尝试sudo mn,然后再尝试python star.py,这也不起作用。
发布于 2020-09-17 17:25:00
尝试下载Mininet代码,并导出路径。
示例:
sudo -i
cd ~
git clone https://github.com/mininet/mininet.git
export PYTHONPATH=$PYTHONPATH:$HOME/mininet
python3 star.pyhttps://stackoverflow.com/questions/63862010
复制相似问题