[Bug 1136634] New: openSUSE matplotlib generates no graph
http://bugzilla.opensuse.org/show_bug.cgi?id=1136634 Bug ID: 1136634 Summary: openSUSE matplotlib generates no graph Classification: openSUSE Product: openSUSE Distribution Version: Leap 15.0 Hardware: x86-64 OS: SUSE Other Status: NEW Severity: Minor Priority: P5 - None Component: Development Assignee: bnc-team-screening@forge.provo.novell.com Reporter: mhenatsch@gmx.de QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0 Build Identifier: I have written a Python program to generate a graphical representation of temperatures over time. The program runs correctly under Raspbian and also under Manjaro. Under both systems it generates the desired graph. Not so under openSUSE - neither under Leap 42.3 nor under Leap 15.0. It throws no exceptions and correctly prints out text, but no graph. The c ode is exactly the same as in the two other operating systems. I had installed matplotlib through Yast from the openSUSE repositories. Examining in Yast the "Technical Data" for matplotlib I found the following: License: SUSE-Matplotlib Vendor: openSUSE Packager: http://bugs.opensuse.org
From this I concluded that the openSUSE-version of matplotlib is non-standard. I uninstalled (with Yast) matplotlib and reinstalled it from the command line with "pip3 install matplotlib". This got me the original version and since then everything runs well, including the generation of graphs.
Reproducible: Always Steps to Reproduce: 1.Create a Python program ending with the following code: plt.plot(timeslist, temperatureslist) plt.ylabel('Temperature [° C]') print(plt.ylabel) plt.xlabel('Time (Date and Time)') print(plt.xlabel) plt.title(timespan, fontsize=16, color='blue') plt.grid(True) plt.show() 2.Run the program. All goes well, except the generation of the graph. 3.Uninstall the SUSE-version of matplotlib and reinstall the library with "pip3 install matplotlb". Run the Python program again. You will see a nice graph! -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1136634 http://bugzilla.opensuse.org/show_bug.cgi?id=1136634#c2 Lucie Charrier <c.chalu@free.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |c.chalu@free.fr Severity|Minor |Normal --- Comment #2 from Lucie Charrier <c.chalu@free.fr> --- I confirm this bug with the python3-matplotlib package in openSUSE Leap 15.1. The Geophar software (source here: https://github.com/wxgeo/geophar, we launch the software by running geophar.pyw) crashes when I want to make a graph with the packages of the openSUSE repositories installed: python3-matplotlib, python3-matplotib-tk, python3-matplotib-qt5 and python3-matplotlib-qt-shared I remove the 4 packages and install matplotlib with the command: sudo pip3 install matplotlib and then everything works! -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1136634 http://bugzilla.opensuse.org/show_bug.cgi?id=1136634#c3 --- Comment #3 from Lucie Charrier <c.chalu@free.fr> --- we can install python3-matplotlib and update with pip3 install --upgrade --user matplotlib then it works without uninstalling the package -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1136634 http://bugzilla.opensuse.org/show_bug.cgi?id=1136634#c4 Andreas Nordal <andreas_nordal_4@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andreas_nordal_4@hotmail.co | |m --- Comment #4 from Andreas Nordal <andreas_nordal_4@hotmail.com> --- 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: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1136634 http://bugzilla.opensuse.org/show_bug.cgi?id=1136634#c5 Giacomo Comes <comes@naic.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |comes@naic.edu --- Comment #5 from Giacomo Comes <comes@naic.edu> --- I have a user starting to learn matplotlib. He follows one of the many examples available everywhere and on openSUSE it doesn't work. It works on CentOS. On openSUSE if matplotlib is installed with pip, then the example works. But if matplotlib is installed with zypper, the example does not work. The reason is that the default backend defined in the openSUSE build is Agg which does not produce any graphic output. I suggest to change in the file matplotlib-setup.cfg in the source rpm the line: backend = Agg to backend = TkAgg And, in such case, the rpm python3-matplotlib should require python3-matplotlib-tk As a workaround, I have suggested my user to add the line backend:tkagg in ~/.config/matplotlib/matplotlibrc Please make matplotlib work even for a beginner. The default backend does not have to be tkagg pick anyone that shows some graphic output. -- You are receiving this mail because: You are on the CC list for the bug.
participants (2)
-
bugzilla_noreply@novell.com
-
bugzilla_noreply@suse.com