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

487 ビュー (過去 30 日間)
Xiao Wang
Xiao Wang 2019 年 7 月 17 日
コメント済み: chaoliang 2024 年 10 月 8 日
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.
  3 件のコメント
Zachary LaFlair
Zachary LaFlair 2020 年 11 月 17 日
For anyone still bashing their heads off the wall in 2020 on R2020b. I'm using Arch Linux on Gnome Xorg. Currently patched at Kernel 5.9.8. I installed from the MATLAB website and created a folder with user permissions in the default install folder. Then ran ./install.
Here's what i used.
I first had to install gtk-2 package from the official arch repos.
sudo pacman -S gtk-2 %it might have worked after this if i didn't mess with my java install so much trying to make it work
Next i had to rollback my java version...
java --version %I had absolutely blown away my java install at this point and grabbed many packages from AUR to no avail so i got the official repo package
sudo pacman -S jre8-openjdk % Installs java
sudo pacman -S jdk8-openjdk % Installs java
Finally set matlab to open with my known good/supported version
export MATLAB_JAVA=/usr/lib/jvm/java-8-openjdk/jre
matlab %%opens MATLAB window without issues or failures
% I can and did plot a polynomial just to make it work
% First plot polynomial code that shows up on google.
y_1 = @(x) -0.6729+4.8266*x-0.4855*x.^2+0.0312*x.^3
x_1 = 0:0.1:33.5;
plot(x_1,y_1(x_1))
Dean
Dean 2024 年 7 月 3 日
編集済み: Dean 2024 年 7 月 3 日
See comment below -- The response from Angel Palacios-Marin was key.

サインインしてコメントする。

回答 (12 件)

Angel Palacios-Marin
Angel Palacios-Marin 2022 年 6 月 11 日
編集済み: 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 件のコメント
Hao Zhu
Hao Zhu 2024 年 9 月 23 日
Worked for MATLAB R2024b, Ubuntu 24.04.
Thank you.
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 件のコメント
ubaidulla
ubaidulla 2022 年 3 月 10 日
This worked for me on ubuntu 20.04; Thank you
Julija Bucar
Julija Bucar 2023 年 2 月 26 日
solution on arch was to export and set GTK_PATH to matlab executable

サインインしてコメントする。


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 件のコメント
Tim Divett
Tim Divett 2021 年 11 月 18 日
worked for me, thanks
Savindi
Savindi 2024 年 6 月 19 日
編集済み: Savindi 2024 年 6 月 19 日
Worked for Ubuntu 24.04 LTS with MATLAB R2024a

サインインしてコメントする。


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
Nour
Nour 2022 年 8 月 11 日
worked for me, thanks !

サインインしてコメントする。


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.
  2 件のコメント
Kefan Yu
Kefan Yu 2021 年 6 月 9 日
It works on R2021a Ubuntu20.04.
Estefania Murcia Lozano
Estefania Murcia Lozano 2021 年 9 月 15 日
Very thankfull.

サインインしてコメントする。


Kehelwala Dewage Gayan Maduranga
Kehelwala Dewage Gayan Maduranga 2020 年 11 月 18 日
編集済み: 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 件のコメント
Imad Abied
Imad Abied 2021 年 5 月 27 日
same on Ubuntu 20.04 and Matlab R2021A
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....
  1 件のコメント
Chen Wang
Chen Wang 2019 年 10 月 12 日
I have installed everything but the problem is still there.

サインインしてコメントする。


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

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by