Gtk-WARNING **: Theme parsing error

已回答

Hi, I am trying to run this code:

import matplotlib
matplotlib.use('GTK3Cairo')
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0,6*np.pi,100)
y = np.sin(x)
plt.figure()
plt.plot(x,y)
plt.show()


and I get these warnings:
(tryMe.py:585): Gtk-WARNING **: Theme parsing error: gtk.css:3415:30: The style property GtkButton:image-spacing is deprecated and shouldn't be used anymore. It will be removed in a future version

(tryMe.py:585): Gtk-WARNING **: Theme parsing error: gtk.css:3416:29: The style property GtkButton:inner-border is deprecated and shouldn't be used anymore. It will be removed in a future version

I can see the plots, but how can I solve or suppress these warnings? Am using Linux Mint 19

I don't understand what exactly is causing these warnings to originate

0

I believe the warnings are from GTK3Cairo backend and are not related to PyCharm. Why do you use this specific backend?

0
Avatar
Permanently deleted user

I get the same just using GTK3 as below:

import gi
gi.require_version('Gtk', '3.0')

from gi.repository import GObject
from gi.repository import Gtk, Gdk

label = Gtk.Label(label="Hello World", angle=25, halign=Gtk.Align.END)

 

0

As Pavel mentioned, those messages are caused by the GTK3 toolkit, and mean there's some features that will be deprecated in future versions.

0

请先登录再写评论。