Closed andynoack closed 2 years ago
humm.. this is strange. Which OS do you have?
Can you try to set the environment variable?
e.g. export MPLBACKEND=TKAgg
Some indicate the use of MacOSX
for MacOS.
So you can try changing https://github.com/intrig-unicamp/mininet-wifi/blob/b1e6a4723355133283ee34226e80c98a62949fc0/mn_wifi/telemetry.py#L17 and recompile the code with sudo make install
For your info: I am using Linux as VM-Host and an Ubuntu VM (20.04 LTS via Vagrant) with Docker (also Ubuntu).
I tried MPLBACKEND=TKAgg util/install.sh -Wlnfv6
but the error keeps the same. Up to now I have not tried to modify the source code yet.
Up to now I have not tried to modify the source code yet.
Can you try this? This is an issue that I unfortunately cannot reproduce and it would be really great if you could help me to find the solution.
I found a solution! Running the installation as DISPLAY=localhost:0.0 util/install.sh -Wlnfv6
solves the problem for me. I can, however, definitely confirm the bug for my (stock?) Ubuntu 20.04 docker environment. Furthermore, I need to add export DISPLAY=localhost:0.0
to the docker command line (CMD) to be able to run mininet-wifi. Otherwise the error "ImportError: Cannot load backend 'TkAgg' which requires the 'tk' interactive framework, as 'headless' is currently running" pops up again.
The error might be connected to the used shell (bash).
Is it possible to add a check whether the environment variable DISPLAY is set and otherwise set it to a default value like DISPLAY=localhost:0.0
? I don't know where the best place for this might be, because both the main application and the installer is affected. Maybe my use case (mininet-wifi in a docker) is so special that it does not concern most of the people. Feel free to close the issue if this is the case. Many thanks for dealing with my question!
Thanks for sharing the solution. :)
I was wondering how can I reproduce the issue. Are there any reproducible steps you could share with me?
Here you go:
Dockerfile (with my fix included):
FROM ubuntu
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -yq install mininet netcat net-tools iproute2 iputils-ping screen tcpdump screen psmisc tshark iptables dnsmasq nftables dnsutils wget sudo git tzdata aircrack-ng openssh-server crunch libnl-route-3-dev make python3-psutil
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10
RUN cd ~; git clone https://github.com/intrig-unicamp/mininet-wifi; cd mininet-wifi; DISPLAY=localhost:0.0 util/install.sh -Wlnfv6
CMD export DISPLAY=localhost:0.0; /etc/init.d/openvswitch-switch start; screen -S mnwifi -d -m mn --wifi
Build with:
docker build --rm --tag mnw .
Run with:
docker run -d --rm --privileged -p 2222:22 -v /lib/modules:/lib/modules -v /sys/kernel/debug:/sys/kernel/debug mnw
By the while, this (TkAgg bug) only affects mininet-wifi but not mininet that I also use in this way.
It seems to me that the problem is that you were using an interactive backend which was trying to open matplotlib. However, it failed because you have disconnected the x-server that was available in your host. That's why you had to export the Display.
By the while, this (TkAgg bug) only affects mininet-wifi but not mininet that I also use in this way.
Mininet does not use matplotlib
Closing due to inactivity
I am using mininet-wifi in an ubuntu docker container. When installing with
I am confronted with the following traceback (python setup.py install):
A stack overflow post [1] indicates that maybe matplotlib.pyplot is used before
in one of the source files. Is there anything I should change in my setup or does anyone know a solution for this problem? Many thanks in advance!
[1] https://stackoverflow.com/questions/55811545/importerror-cannot-load-backend-tkagg-which-requires-the-tk-interactive-fra