Failed to load module canberra-gtk-module

OS = Ubuntu 18.04
Julia version = Version 1.8.5 (2023-01-08)

When using Julia REPL, I type 'using Gtk and every time I get 3 ‘Gtk-Message: 09:14:02.463: Failed to load module “canberra-gtk-module”’ messages. If I type ‘using Pkg’ and then type ‘using Gtk’ I no longer get the ‘Gtk-Message: 09:14:02.463: Failed to load module “canberra-gtk-module”’. How can I make the julia REPL perform the ‘using Gtk’ command correctly the first time I use it without needing to type ‘using Pkg’?

I ensured that the canberra-gtk-module is already installed.

Check the green box with the tip at Home · Gtk.jl
It says:

On some platforms, you may see messages like

Gtk-Message: 20:15:48.288: Failed to load module “canberra-gtk-module”

These are harmless. If you want to suppress them, on Unix platforms you can add something like

export GTK_PATH=$GTK_PATH:/usr/lib/x86_64-linux-gnu/gtk-3.0

to your .bashrc file. (You may need to customize the path for your system; it should have a modules directory containing libcanberra.)

2 Likes

Hello, welcome back to this forum :slight_smile:
Great your issue has been solved quickly.
For the future, I suggest you to use a more informative title to your posts. For example for this post something on the line of:

“Failed to load module canberra-gtk-module”” message when trying to use Gtk

2 Likes

I’ve been getting a similar error and I tried this (I used /bin/lib64/gtk-3.0) but it still didn’t work. Btw my distro is OpenSuse if that helps.