Andreas Nordal changed bug 1136634
What Removed Added
CC   andreas_nordal_4@hotmail.com

Comment # 4 on bug 1136634 from
Testcase:

$ env -i DISPLAY=nimportequoi python3 -c 'import matplotlib;
print(matplotlib.get_backend())'
Qt5Agg

$ env -i python3 -c 'import matplotlib; print(matplotlib.get_backend())'
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
(-c:27058): Gdk-CRITICAL **: 22:19:42.241: gdk_cursor_new_for_display:
assertion 'GDK_IS_DISPLAY (display)' failed
(-c:27058): Gdk-CRITICAL **: 22:19:42.248: gdk_cursor_new_for_display:
assertion 'GDK_IS_DISPLAY (display)' failed
agg

This is the working case, after uninstalling matplotlib, and installing it via
pip3.
In the non-working case, both return "agg".

Explanation in Matplotlib's user guide:

https://matplotlib.org/3.2.1/tutorials/introductory/usage.html

    If no backend is explicitly set, Matplotlib automatically detects a
    usable backend based on what is available on your system and on whether
    a GUI event loop is already running. On Linux, if the environment variable
    DISPLAY is unset, the "event loop" is identified as "headless", which
    causes a fallback to a noninteractive backend (agg).


You are receiving this mail because: