Gtk-Message: 10:32:31.466: Failed to load module "canberra-gtk-module"

491 次查看(过去 30 天)
I installed matlab 2019a with update3 on ubuntu 16.04 64bit. When I run matlab, I got output: Gtk-Message: 10:32:31.466: Failed to load module "canberra-gtk-module".
How to sort this problem.
Thanks in advance.
  4 个评论
Dean
Dean 2024-7-3
编辑:Dean 2024-7-3
See comment below -- The response from Angel Palacios-Marin was key.
Michael Levy
Michael Levy 2025-2-27
编辑:Walter Roberson 2025-2-27
This is not working for me. When I type MATLAB from linux Ubuntu command window, what appears is failed ot load module "canberra-gtk-module" I follow the instructions in
however, in my /lib/x86_64-linux-gnu folder I see gtk-2.0, gtk-3.0, and gtk-4.0 . Which of these am I supposed to use????
Moving on, the answer here is a bit dated and overly specific without explaining how to generalize.
For example, I write export MATLAB_JAVA=/usr/lib/jvm/java-1.21.0-openjdk-amd64
This is because when I try to find where my ---- (I do not know is it is abin file? a run file? execuatable file? nonone tells)
The reason I type that is because from https://stackoverflow.com/questions/5251323/where-can-i-find-the-java-sdk-in-linux-after-installing-it I see that update-java-alternatives -l will tell you which java implementation is the default for your system and where in the filesystem it is installed.
I need help. Please MATLAB help me

请先登录,再进行评论。

回答(13 个)

Angel Palacios-Marin
编辑:Angel Palacios-Marin 2022-6-11
So the answer is in a terminal excecute the following
sudo apt-get install libcanberra-gtk* libgconf-2-4
sudo ln -s /usr/lib/x86_64-linux-gnu/gtk-2.0/modules/libcanberra-gtk-module.so /usr/lib/libcanberra-gtk-module.so
The second line will create a link to the module. Matlab works with gtk-2.0 module. For other linux distributions follow this.
Problem solved, at least for me.
  25 个评论
chaoliang
chaoliang 2024-10-8
Worked for matlab 2022b. But we use the command of 'sudo apt-get -y install libcanberra-gtk-module' to install libcanberra-gtk. The second step is important. Don't forget to create link under /usr/lib directory using the command uppon. If the Linux version and related gtk version is different, you should check it under the /usr/lib/*-linux-gnu/gtk-*.

请先登录,再进行评论。


Scott Minkin
Scott Minkin 2019-12-15
编辑:Scott Minkin 2019-12-15
I believe the canberra-gtk-module messages have no detrimental effect on MATLAB and can be ignored, but having said that...
To run MATLAB R2019a or R2019b on Ubuntu 16.04 LTS without the canberra-gtk-message:
You have three environmental variables that need to be set before running matlab
export GTK_PATH=/usr/lib/x86_64-linux-gnu/gtk-2.0
export LIBOVERLAY_SCROLLBAR=0
export GIO_EXTRA_MODULES=/usr/lib/x86_64-linux-gnu/gio/modules
OR you can run matlab in the bash shell by typing:
$ GTK_PATH=/usr/lib/x86_64-linux-gnu/gtk-2.0 LIBOVERLAY_SCROLLBAR=0 GIO_EXTRA_MODULES=/usr/lib/x86_64-linux-gnu/gio/modules /usr/local/MATLAB/R2019a/bin/matlab
----
To run R2019a on Ubuntu 18.04 LTS without the canberra-gtk-message:
You need to install libcanberra-gtk-module and libgconf-2-4
You don't need to set any environmental variables.
----
To run R2019b on Ubuntu 18.04 LTS without the canberra-gtk-message:
you need to install libcanberra-gtk-module
You have one environmental variable that needs to be set before running matlab:
export GTK_PATH=/usr/lib/x86_64-linux-gnu/gtk-2.0
OR you can run matlab in the bash shell by typing:
$ GTK_PATH=/usr/lib/x86_64-linux-gnu/gtk-2.0 /usr/local/MATLAB/R2019b/bin/matlab
Good luck.
  6 个评论

请先登录,再进行评论。


Xiao Wang
Xiao Wang 2019-7-18
I did: sudo apt-get install libcanberra-gtk-module libcanberra-gtk0. But the error message is still there.
  12 个评论

请先登录,再进行评论。


Jan Studnicka
Jan Studnicka 2019-10-16
See bug reports:
"On some Linux distributions, a message appears in the terminal window when starting MATLAB:
Gtk-Message: <timestamp>: Failed to load module "canberra-gtk-module"
and/or
Gtk-Message: <timestamp>: Failed to load module "pk-gtk-module"
This message is informational and has no effect on MATLAB."
  3 个评论
Robert Eng
Robert Eng 2020-11-26
I tried the work around suggested in the "bug report" from the above link. Did not fix the problem. I can use the matlab as is with the error but irritating to keep the terminal open and running otherwise Matlab closes

请先登录,再进行评论。


Frederico Azevedo
Frederico Azevedo 2019-12-14
I had the same error with my R2019b installation in ubuntu 19.10. After I installed the module with "sudo apt install libcanberra-gtk-module -y", if I call matlab from the command line with the cmd "LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/gtk-2.0/modules:$LD_LIBRARY_PATH /usr/local/bin/matlab", the error message doesn't appear anymore.

Kehelwala Dewage Gayan Maduranga
编辑:Kehelwala Dewage Gayan Maduranga 2020-11-18
I am installing matlab R2020b on Ubuntu 18.04 and having this error
Gtk-Message: 17:15:55.104: Failed to load module "canberra-gtk-module"
  8 个评论
Paul Galloux
Paul Galloux 2022-2-1
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/gtk-2.0/modules:$LD_LIBRARY_PATH
before to launch matlab or put this line in your .bashrc
solve-it for me ub20.04

请先登录,再进行评论。


Chen Wang
Chen Wang 2019-10-12
I have encountered the same problem....

Chen Wang
Chen Wang 2019-10-12
Finally I solve this problem by change from 2019b to 2019a. The error message disappear. There must be something wrong with 2019b's Linux version.

Alex Pedcenko
Alex Pedcenko 2019-11-28
this is not the "problem"

LeChat
LeChat 2020-1-16
编辑:LeChat 2020-1-16
It had the same message and then I followed @Scott Minkin recommandation and I still have a message, but a different one:
me@myPC:~$ matlab &
[1] 22115
me@myPC:~$ Gtk-Message: 17:29:07.572: Failed to load module "canberra-gtk-module"
[0116/172911.622390:INFO:context.cpp(159)] Using multi-threaded message loop for Linux
me@myPC:~$ export GTK_PATH=/usr/lib/x86_64-linux-gnu/gtk-2.0
[1]+ Done matlab
me@myPC:~$ matlab &
[1] 29896
me@myPC:~$ [0116/173302.576327:INFO:context.cpp(159)] Using multi-threaded message loop for Linux
I then tried this:
me@myPC:~$ sudo apt install libcanberra-gtk-module libcanberra-gtk3-module
Reading package lists... Done
Building dependency tree
Reading state information... Done
libcanberra-gtk3-module is already the newest version (0.30-7ubuntu1).
libcanberra-gtk-module is already the newest version (0.30-7ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 13 not upgraded.
me@myPC:~$ matlab &
[2] 7532
me@myPC:~$ [0116/173838.654136:INFO:context.cpp(159)] Using multi-threaded message loop for Linux
In both case Matlab 2019b is launched as expected but I am wondering if everything is ok because of the messages I keep having in the Terminal.
I am running Ubuntu 19.10. Thank you for your expertise.
  3 个评论
Scott Minkin
Scott Minkin 2020-4-8
Not sure why the pk-gtk-module warning is coming up. What is the value of $GTK_MODULES? And can you try blanking it out by setting GTK_MODULES=
GTK_PATH=/usr/lib/x86_64-linux-gnu/gtk-2.0 GTK_MODULES= matlab
Good luck.
--Scott
Manuel Mercier
Manuel Mercier 2020-4-16
GTK_PATH=/usr/lib/x86_64-linux-gnu/gtk-2.0 GTK_MODULES = matlab
launch Matlab, and display
Failed to load module "pk-gtk-module"
in the console

请先登录,再进行评论。


Burcin Arici
Burcin Arici 2020-4-9
I also get the same error message while running
Gtk-Message: 04:38:48.679: Failed to load module "canberra-gtk-module"
for Matlab R2020a on Ubuntu 19.10, it works slower than R2019b but untill now, during running the program, it does not give an another error.

Chase Philport
Chase Philport 2022-12-7
Also having this error with my install

Leonardo
Leonardo 2025-3-5
Had the same problem on EndeavourOS (Arch-based). By looking through yay I saw that libcanberra was actually installed, but running again
yay -S libcanberra
solved the problem apparently. I have been using MATLAB R2024b Revision 5.

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by