Crashes on start : NameError: name '_' is not defined

Bug #1095665 reported by Mark M Lambert on 2013-01-03
This bug affects 19 people
Affects Status Importance Assigned to Milestone
magicicada gui
magicicada (Ubuntu)

Bug Description

Running on Ubuntu 12.10 64 bit
Version 0.5-0ubuntu1

When I run magicicada from command line it crashes with following output:

Traceback (most recent call last):
  File "/usr/bin/magicicada", line 36, in <module>
    from magicicada.gui.gtk import MagicicadaUI
  File "/usr/lib/python2.7/dist-packages/magicicada/gui/gtk/", line 24, in <module>
    from magicicada.gui.gtk.main import MagicicadaUI
  File "/usr/lib/python2.7/dist-packages/magicicada/gui/gtk/", line 43, in <module>
    from magicicada.gui.gtk.operations import Operations
  File "/usr/lib/python2.7/dist-packages/magicicada/gui/gtk/", line 40, in <module>
    OPS_COMPLETED = _(u'Completed %s ago (%s)')
NameError: name '_' is not defined

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in magicicada (Ubuntu):
status: New → Confirmed
Christopher Townsend (townsend) wrote :

I just ran into this on 13.04 as well w/ version 0.5-0ubuntu1.

Changed in magicicada:
status: New → Confirmed
assignee: nobody → Christopher Townsend (townsend)
status: Confirmed → In Progress
Manfred Hampl (m-hampl) wrote :

I guess there is the line

from gettext import gettext as _

missing at the beginning (~ line 30) in usr/share/pyshared/magicicada/gui/gtk/


Evandro P. Alves (evandro-pa) wrote :


I just added

from gettext import gettext as _



and the problem went away

Ibuntu (ibun-do-ubuntu) wrote :

I previously commented to attest the validity of Evandro's solution. After reinstalling and reapplying the fix, I noticed that it is very important where you place:

from gettext import gettext as _

in the three files. Initially I placed them too high and Magicicada would not start. So just for clarification, open each of these three files:


and add the line:

from gettext import gettext as _

to each of them, right after the line:

# pylint: enable=E0611

and that should work. This is usually right above any lines saying 'import magicicada ....' but also above another import in one of the files. I have tested that as long as 'from gettext import gettext as _' is after '# pylint: enable=E0611' and before any lines that say 'import magicicada ...' in all three files, that it works.

Changed in magicicada:
status: In Progress → Confirmed
assignee: Christopher Townsend (townsend) → nobody
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Related questions