'ImportError: No module named mininet.log

I am working on mininet when I run miniedit without sudo it gives me error

*** Mininet must run as root.

But when I run it as root it gives me a new error

Traceback (most recent call last):
  File "./miniedit.py", line 27, in <module>
    from mininet.log import info, debug, warn, setLogLevel
ImportError: No module named mininet.log

Please help me resolve this error



Solution 1:[1]

I make a test with pycharm and if you install the library with the command : pip install mininet

your import may not have any error

maybe you installed your library with : sudo pip install mininet and your library is only available for root user

try sudo pip uninstall mininet and pip install mininet

Solution 2:[2]

Try :

PYTHON=python3 util/install.sh -fnv from https://github.com/mininet/mininet/blob/master/INSTALL

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Kal-1
Solution 2 Nagmat