Bug 2911 - alacarte won't run: No module named gmenu
: alacarte won't run: No module named gmenu
Status: RESOLVED FIXED
Product: Mageia
Classification: Unclassified
Component: RPM Packages
: Cauldron
: x86_64 Linux
: Normal Severity: normal
: ---
Assigned To: Olav Vitters
:
:
: MGA2TOO MGA3TOO
: NEEDINFO, NO_PATCH, UPSTREAM
:
:
  Show dependency treegraph
 
Reported: 2011-10-02 17:58 CEST by Dick Gevers
Modified: 2015-04-22 13:39 CEST (History)
16 users (show)

See Also:
Source RPM: alacarte-0.13.2-3.mga1
CVE:
Status comment:


Attachments
Alacarte-archive built from Gnome git-branch (241.60 KB, application/x-gzip)
2012-06-13 00:49 CEST, Kristoffer Grundström
Details

Description Dick Gevers 2011-10-02 17:58:06 CEST
Description of problem:

When I try to start alacarte from console, I see:

$ alacarte &
[1] 9859
$ Traceback (most recent call last):
  File "/usr/bin/alacarte", line 22, in <module>
    from Alacarte.MainWindow import MainWindow
  File "/usr/lib/python2.7/site-packages/Alacarte/MainWindow.py", line 19, in <module>
    import gtk, gmenu, gobject, gio
ImportError: No module named gmenu

[1]+  Exit 1                  alacarte

A while ago I searched for similar problems but did not really find what it could be. Perhaps a missing dependency in Cauldron?

IIRC it worked okay in Mageia 1, and probably even in Cauldron before GNOME 3.2
Comment 1 Olav Vitters 2011-10-27 14:00:23 CEST
Alacarte needs to be rewritten to use gobject introspection. I've started that, but gmenu is really difficult (totally different API), maybe I can finish it in GNOME 3.4.
Comment 2 Manuel Hiebel 2011-12-04 21:00:53 CET
*** Bug 3604 has been marked as a duplicate of this bug. ***
Comment 3 Manuel Hiebel 2011-12-04 21:01:38 CET
*** Bug 3534 has been marked as a duplicate of this bug. ***
Comment 4 Manuel Hiebel 2012-04-19 18:47:35 CEST
*** Bug 5492 has been marked as a duplicate of this bug. ***
Comment 5 Manuel Hiebel 2012-05-21 19:46:45 CEST
*** Bug 6010 has been marked as a duplicate of this bug. ***
Comment 6 Tyler 2012-05-21 19:51:34 CEST
Ah good, so it has been reported before. Kind of silly that alacarte has suddenly changed like this. Might be time for a new menu editor that doesn't have any desktop requirement come out! ...damnit I need to get better at programming, already!
Comment 7 Olav Vitters 2012-05-23 21:59:51 CEST
Alacarte 0.13.3 should fix this.
Comment 8 Marja van Waes 2012-05-26 13:05:24 CEST
Hi,

This bug was filed against cauldron, but we do not have cauldron at the moment.

Please report whether this bug is still valid for Mageia 2.

Thanks :)

Cheers,
marja
Comment 9 Dick Gevers 2012-05-28 12:39:55 CEST
Olav's comment #c7 should apply to 2 and Cauldron
Comment 10 Olav Vitters 2012-05-28 13:48:12 CEST
I understood from the person who released 0.13.3 that there are still some crashers in there. This is why it isn't released as stable (0.14.0) yet.

I've build alacarte 0.13.3 for Cauldron. Should install fine on Mageia 2. Built it just now, so didn't try myself yet.

If this is provided as an update, then we probably need to provide updates until 0.14.x.
Comment 11 Alberto Girlando 2012-05-28 15:58:04 CEST
Problem remains with the final release of Mageia 2. The problem has been already spotted in Fedora:

https://bugzilla.redhat.com/show_bug.cgi?id=734442

and as far as I understand, it is still present in fedore 17. A workaround is to install some additional files, among which gmenu.so.
Comment 12 Olav Vitters 2012-05-28 23:01:14 CEST
(In reply to comment #11)
> Problem remains with the final release of Mageia 2. The problem has been
> already spotted in Fedora:

I never implied that this bug was fixed?

Anyway, the 0.13.3 is still broken.
Comment 13 Olav Vitters 2012-06-02 22:39:52 CEST
0.13.4 is still broken due to missing functionality in gnome-menu

See bugs:
https://bugzilla.gnome.org/show_bug.cgi?id=677344
https://bugzilla.gnome.org/show_bug.cgi?id=677343
Comment 14 Alberto Girlando 2012-06-03 08:45:29 CEST
I found this workaround:

http://blog.mclaughlinsoftware.com/2011/11/24/gnome-menu-editing-fix/

It concerns Fedora. Essentially, the author suggests to download from the previous version of Fedora the package gnome-menus, disassemble it in a provisional directory, and manually copy libgnome-menu and gmenu in the appropriate place. I followed the instructions, and now alacarte works in my fresh mageia2 installation.

I am not an expert, but it seems it is a problem of packaging, which could be easily fixed in the official distribution
Comment 15 Kristoffer Grundström 2012-06-13 00:35:27 CEST
I still see this issue to.

** (process:17093): WARNING **: Trying to register gtype 'GMountMountFlags' as enum when in fact it is of type 'GFlags'

** (process:17093): WARNING **: Trying to register gtype 'GDriveStartFlags' as enum when in fact it is of type 'GFlags'

** (process:17093): WARNING **: Trying to register gtype 'GSocketMsgFlags' as enum when in fact it is of type 'GFlags'
Traceback (most recent call last):
  File "/usr/bin/alacarte", line 22, in <module>
    from Alacarte.MainWindow import MainWindow
  File "/usr/lib/python2.7/site-packages/Alacarte/MainWindow.py", line 19, in <module>
    import gtk, gmenu, gobject, gio
ImportError: No module named gmenu
Comment 16 Kristoffer Grundström 2012-06-13 00:49:19 CEST
Created attachment 2451 [details]
Alacarte-archive built from Gnome git-branch

Please feel free to make a RPM of it to test.
Comment 17 Olav Vitters 2012-06-13 10:53:31 CEST
I've added the missing API in gnome-menus and added a patch to fix a typo. Latest Alacarte in Cauldron should work.

HOWEVER: It requires a modified gnome-menus.
Comment 18 Olav Vitters 2012-06-13 18:05:16 CEST
Upstream is going to release a new 3.4.x gnome-menus with the new API. Once that is done, I can push Alacarte as an update.

Please do test the Cauldron version.. I'd be updating to a development version of Alacarte. Only checked that it starts atm.
Comment 19 Manuel Hiebel 2012-07-28 18:35:39 CEST
*** Bug 6893 has been marked as a duplicate of this bug. ***
Comment 20 Michael Martins 2012-07-30 21:32:04 CEST
[xgrind@localhost ~]$ alacarte
/usr/lib/python2.7/site-packages/gi/overrides/Gtk.py:47: RuntimeWarning: You have imported the Gtk 2.0 module.  Because Gtk 2.0 was not designed for use with introspection some of the interfaces and API will fail.  As such this is not supported by the pygobject development team and we encourage you to port your app to Gtk 3 or greater. PyGTK is the recomended python module to use with Gtk 2.0
  warnings.warn(warn_msg, RuntimeWarning)
Traceback (most recent call last):
  File "/usr/bin/alacarte", line 36, in <module>
    main()
  File "/usr/bin/alacarte", line 33, in main
    app.run()
  File "/usr/lib/python2.7/site-packages/Alacarte/MainWindow.py", line 62, in run
    self.loadMenus()
  File "/usr/lib/python2.7/site-packages/Alacarte/MainWindow.py", line 192, in loadMenus
    self.loadMenu({ None: None })
  File "/usr/lib/python2.7/site-packages/Alacarte/MainWindow.py", line 208, in loadMenu
    iters[menu] = self.menu_store.append(iters[parent], (icon, name, menu))
  File "/usr/lib/python2.7/site-packages/gi/overrides/Gtk.py", line 1193, in append
    return self._do_insert(parent, -1, row)
  File "/usr/lib/python2.7/site-packages/gi/overrides/Gtk.py", line 1186, in _do_insert
    treeiter = self.insert_with_values(parent, position, columns, row)
AttributeError: 'TreeStore' object has no attribute 'insert_with_values'

Mageia 2 i586; alacarte-3.5.4-1.mga3.noarch.rpm
Comment 21 Jani Välimaa 2012-09-19 10:01:39 CEST
*** Bug 6488 has been marked as a duplicate of this bug. ***
Comment 22 andré blais 2012-11-05 13:33:27 CET
an easy all-mga workaround for mga2 :

* for first error message "ImportError: No module names gmenu"
from python-gnome-menus-2.30.5-2.mga1.{arch}.rpm (release package, on dvd)
extract /usr/lib/python2.7/site-pachages/gmenu* (3 files)
and copy to disk (same directory).

* to avoid a subsequent error message about missing libgnome-menu.so.2
install libgnome-menu2-2.30.5-2.mga1.{arch}.rpm (release package, on dvd)
which doesn't conflict with the mga2 version.

Works like a charm.
Comment 23 Dylan Myers 2012-11-25 17:38:33 CET
Here is the step by step for what andre blais suggested above:

64bit:
cd /tmp
mkdir mga1
cd mga1
rpm2cpio http://mirror.internode.on.net/pub/mageia/distrib/1/x86_64/media/core/release/python-gnome-menus-2.30.5-2.mga1.x86_64.rpm | cpio -ivd
sudo cp -R usr/* /usr/
sudo urpmi http://mirror.internode.on.net/pub/mageia/distrib/1/x86_64/media/core/release/lib64gnome-menu2-2.30.5-2.mga1.x86_64.rpm

32bit:
cd /tmp
mkdir mga1
cd mga1
rpm2cpio http://mirror.internode.on.net/pub/mageia/distrib/1/i586/media/core/release/python-gnome-menus-2.30.5-2.mga1.i586.rpm | cpio -ivd
sudo cp -R usr/* /usr/
sudo urpmi http://mirror.internode.on.net/pub/mageia/distrib/1/i586/media/core/release/libgnome-menu2-2.30.5-2.mga1.i586.rpm

And voila, alacarte works like a charm.

Of course, you can now remove mga1 from /tmp if you wish to reclaim that space (I have my /tmp cleaned on each boot, but that isn't the default):
cd /tmp
rm -Rf mga1

I hope this gets fixed soon, because its annoying as hell ;)
Actually, I just hope that Mate gets into Mageia 3.
Comment 24 Kim Garren 2012-12-17 04:29:56 CET
Just thought I'd drop my three cents in that I'm experiencing this issue on a new install of Mageia 2. I haven't been able to update it due to a very slow internet connection, but will have one tomorrow to see if there is anything in updates. In the meantime, I'll try this in the last comment above me here.

.:[ dedanna@dedanna.rocks.net : 19:58:36 : ~ ]:.
:) alacarte

** (process:12730): WARNING **: Trying to register gtype 'GMountMountFlags' as enum when in fact it is of type 'GFlags'

** (process:12730): WARNING **: Trying to register gtype 'GDriveStartFlags' as enum when in fact it is of type 'GFlags'

** (process:12730): WARNING **: Trying to register gtype 'GSocketMsgFlags' as enum when in fact it is of type 'GFlags'
Traceback (most recent call last):
  File "/usr/bin/alacarte", line 22, in <module>
    from Alacarte.MainWindow import MainWindow
  File "/usr/lib/python2.7/site-packages/Alacarte/MainWindow.py", line 19, in <module>
    import gtk, gmenu, gobject, gio
ImportError: No module named gmenu
.:[ dedanna@dedanna.rocks.net : 19:58:40 : ~ ]:.

And yeah, it is frustrating as hell.
Comment 25 Kim Garren 2012-12-17 04:32:00 CET
(In reply to comment #24)
> Just thought I'd drop my three cents in that I'm experiencing this issue on a
> new install of Mageia 2. I haven't been able to update it due to a very slow
> internet connection, but will have one tomorrow to see if there is anything in
> updates. In the meantime, I'll try this in the last comment above me here.
> 
> .:[ dedanna@dedanna.rocks.net : 19:58:36 : ~ ]:.
> :) alacarte
> 
> ** (process:12730): WARNING **: Trying to register gtype 'GMountMountFlags' as
> enum when in fact it is of type 'GFlags'
> 
> ** (process:12730): WARNING **: Trying to register gtype 'GDriveStartFlags' as
> enum when in fact it is of type 'GFlags'
> 
> ** (process:12730): WARNING **: Trying to register gtype 'GSocketMsgFlags' as
> enum when in fact it is of type 'GFlags'
> Traceback (most recent call last):
>   File "/usr/bin/alacarte", line 22, in <module>
>     from Alacarte.MainWindow import MainWindow
>   File "/usr/lib/python2.7/site-packages/Alacarte/MainWindow.py", line 19, in
> <module>
>     import gtk, gmenu, gobject, gio
> ImportError: No module named gmenu
> .:[ dedanna@dedanna.rocks.net : 19:58:40 : ~ ]:.
> 
> And yeah, it is frustrating as hell.

Oh, sorry, this is on a Toshiba netbook (N255 model, I believe).

:) rpm -q alacarte
alacarte-0.13.2-3.mga1
Comment 26 Kim Garren 2013-03-24 17:22:44 CET
Sorry, Dylan Myers' method, with each command copied from here and pasted into terminal, does not work. Errors:

[dedanna@dedanna ~]$ alacarte

** (process:9186): WARNING **: Trying to register gtype 'GMountMountFlags' as enum when in fact it is of type 'GFlags'

** (process:9186): WARNING **: Trying to register gtype 'GDriveStartFlags' as enum when in fact it is of type 'GFlags'

** (process:9186): WARNING **: Trying to register gtype 'GSocketMsgFlags' as enum when in fact it is of type 'GFlags'
Traceback (most recent call last):
  File "/usr/bin/alacarte", line 36, in <module>
    main()
  File "/usr/bin/alacarte", line 32, in main
    app = MainWindow(datadir, version, sys.argv)
  File "/usr/lib/python2.7/site-packages/Alacarte/MainWindow.py", line 48, in __init__
    self.editor = MenuEditor()
  File "/usr/lib/python2.7/site-packages/Alacarte/MenuEditor.py", line 36, in __init__
    self.__loadMenus()
  File "/usr/lib/python2.7/site-packages/Alacarte/MenuEditor.py", line 56, in __loadMenus
    self.settings.path = os.path.join(util.getUserMenuPath(), self.settings.tree.get_menu_file()) 	 
  File "/usr/lib/python2.7/posixpath.py", line 66, in join
    if b.startswith('/'):
AttributeError: 'NoneType' object has no attribute 'startswith'

Is there something else I need to do? Thanks.
Comment 27 andré blais 2013-03-25 02:53:02 CET
Look at comment 22

step 1)
 from  python-gnome-menus-2.30.5-2.mga1.{arch}.rpm
 a release package of mga1
 extracts /usr/{lib}/python2.7/site-packages/gmenu* (3 files)
 to the same directory on disk
 Check that these 3 files are present : gmenu.a, gmenu.la gmenu.so
 If not, redo this step.

step 2)
 check that  libgnome-menu2-2.30.5-2.mga1.{arch}.rpm  is installed.
 It is a release package from mga1
(One need not be root for this step.)
It might be a useful to download the rpm before installing.

For 32 bit, {arch} = i586, {lib} = lib
For 64 bit, {arch} = x86_64, {lib} = lib64

Comment 23 offers an approach with more details and some extra steps.
Comment 28 Manuel Hiebel 2013-10-22 12:19:49 CEST
This message is a reminder that Mageia 2 is nearing its end of life.
Approximately one month from now Mageia will stop maintaining and issuing updates for Mageia 2. At that time this bug will be closed as WONTFIX (EOL) if it remains open with a Mageia 'version' of '2'.

Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Mageia version prior to Mageia 2's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Mageia 2 is end of life.  If you would still like to see this bug fixed and are able to reproduce it against a later version of Mageia, you are encouraged to click on "Version" and change it against that version of Mageia.

Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Mageia release includes newer upstream software that fixes bugs or makes them obsolete.

-- 
The Mageia Bugsquad
Comment 29 Denis Prost 2013-10-28 08:49:59 CET
Looks fixed in Mageia 3.
Comment 30 Dick Gevers 2013-10-29 00:19:53 CET
I dunno what the use still is of this report at this stage for this package, but for me in Cauldron (M4) the package does not do anything whatsoever since date of report. So in current Cauldron it is not fixed.
Comment 31 andré blais 2013-10-29 02:39:10 CET
Right, it still doesn't work in mga3 as well.
(The gmenu* files are still missing.)
(I had thought it was a final indication of some corruption on my system.)

So I set the mga version to cauldron (based on comment 30) and added MGA3TOO to the whiteboard.
Comment 32 Dylan Myers 2013-10-29 03:31:23 CET
Well... I'm running MGA3 now and alacarte is working just fine for me. Fully up to date. Not sure why it would be broken again in cauldron since I'm not playing with cauldron currently due to lack of time as a student.
Comment 33 Dylan Myers 2013-10-29 03:32:42 CET
RE My previous:
I should mention this was a clean install, not an upgrade from MGA2. So perhaps it's due to upgrading?
Comment 34 andré blais 2013-10-29 03:43:57 CET
When you say alacarte is working just fine, you mean you can use alacarte to *modify* the menu ?
Since it properly displays entries added/deleted by installs, but any attempts to add items produces unusable entries.
So if you just use alacarte to view the me
nu (without seeing details) it should look ok.
Comment 35 Alberto Girlando 2013-10-29 07:56:54 CET
I reported the bug also for Mageia 3 (bug 10091, still open). My post is so far the last of the series, it was issued on 2013-05-29 11. As said in that post, alacarte does not run as it should also in fresh installation. Since then, I am using menulibre, which works well although in its present version does not allow to introduce new categories (for instance, Chemistry for the Chemistry programs whihc I use). I also tested shortly Mageia alpha2, and alacarte was not provided by default. I installed it, but again did not work (this was not a full test, however).
Comment 36 Manuel Hiebel 2013-10-29 19:23:39 CET
then change version as said
Comment 37 Alberto Girlando 2013-10-30 08:38:25 CET
(In reply to Manuel Hiebel from comment #36)
> then change version as said

I am not a developer, only a user that signals a bug. I was notified of the closure of this bug because of the end of the cycle of Mageia2. I did not oppose and did not repoened the bug. Can I myself chage the version of Mageia from Mageia 2 to Mageia 3 ? I don't know, in any case it is not correct, as the malfunction is different. So I think this bug should be closed, and users referred to bug 1009 of Mageia 3.
Comment 38 andré blais 2013-10-30 19:54:23 CET
(In reply to Manuel Hiebel from comment #36)
> then change version as said

I've already updated the version & whiteboard (to cauldron & MGA3TOO)
Comment 39 Samuel Verschelde 2015-04-22 11:37:34 CEST
Is this bug still valid in Mageia 4? In cauldron? See also https://bugs.mageia.org/show_bug.cgi?id=12153#c8
Comment 40 andré blais 2015-04-22 13:39:35 CEST
(In reply to Samuel VERSCHELDE from comment #39)
> Is this bug still valid in Mageia 4? In cauldron? See also
> https://bugs.mageia.org/show_bug.cgi?id=12153#c8

This was fixed a long time ago, I think in mga3.
So closing as fixed.

The other bug is still present.

Note You need to log in before you can comment on or make changes to this bug.