You are not logged in.

#1 2020-02-11 03:59:04

ruthra
Member
Registered: 2020-02-11
Posts: 4

[solved]deluge not working - unable to initialize gettext/locale error

On a fresh arch installation after installing deluge through pacman, tried opening it. The GUI window pops up for a second and vanishes. when i tried it in console, got the below error message.

Unable to initialize gettext/locale!
'ngettext'
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/deluge/i18n/util.py", line 118, in setup_translation
    builtins.__dict__['_n'] = builtins.__dict__['ngettext']
KeyError: 'ngettext'
Traceback (most recent call last):
  File "/usr/bin/deluge", line 11, in <module>
    load_entry_point('deluge==2.0.4.dev23', 'gui_scripts', 'deluge')()
  File "/usr/lib/python3.8/site-packages/deluge/ui/ui_entry.py", line 143, in start_ui
    ui.start()
  File "/usr/lib/python3.8/site-packages/deluge/ui/gtk3/__init__.py", line 43, in start
    from .gtkui import GtkUI
  File "/usr/lib/python3.8/site-packages/deluge/ui/gtk3/gtkui.py", line 21, in <module>
    gi.require_version('Gtk', '3.0')  # NOQA: E402
AttributeError: module 'gi' has no attribute 'require_version'

But, i've setup and generated my locale.
output of "local -a"

C
POSIX
en_US
en_US.iso88591
en_US.utf8

How can i fix this issue?

Last edited by ruthra (2020-02-12 16:31:47)

Offline

#2 2020-02-11 08:35:36

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 10,408

Re: [solved]deluge not working - unable to initialize gettext/locale error

And the output of just

locale

Offline

#3 2020-02-11 16:34:26

ruthra
Member
Registered: 2020-02-11
Posts: 4

Re: [solved]deluge not working - unable to initialize gettext/locale error

Getting below output for 'locale'

$ locale
LANG=C
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=

Offline

#4 2020-02-11 16:52:55

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 10,408

Re: [solved]deluge not working - unable to initialize gettext/locale error

That's wrong, set your locale properly:  https://wiki.archlinux.org/index.php/Lo … the_locale

Offline

#5 2020-02-11 17:42:45

ruthra
Member
Registered: 2020-02-11
Posts: 4

Re: [solved]deluge not working - unable to initialize gettext/locale error

Changed the locale as per the instructions in the link and did a reboot. Now 'locale' give below output, but Deluge still throwing the same error.

$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

Offline

#6 2020-02-11 22:12:12

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 7,863

Re: [solved]deluge not working - unable to initialize gettext/locale error

Did you pay attention to the optional deps that pacman told you about when you installed it?

Offline

#7 2020-02-11 22:17:18

loqs
Member
Registered: 2014-03-06
Posts: 11,534

Re: [solved]deluge not working - unable to initialize gettext/locale error

gtk3 (optional) - gtk ui
libappindicator-gtk3 (optional) - appindicator notifications
libnotify (optional) - desktop notifications
librsvg (optional) - gtk ui
python-cairo (optional) - gtk ui
python-gobject (optional) - gtk ui

Offline

#8 2020-02-12 01:39:55

ruthra
Member
Registered: 2020-02-11
Posts: 4

Re: [solved]deluge not working - unable to initialize gettext/locale error

Its working. I installed the below python packages and now deluge is working.

python-cairo (optional) - gtk ui
python-gobject (optional) - gtk ui

I did notice one thing, the 'unable to initialize gettext/locale' error still appears when i open it from terminal. But its not creating any issues.

$ deluge
Unable to initialize gettext/locale!
'ngettext'
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/deluge/i18n/util.py", line 118, in setup_translation
    builtins.__dict__['_n'] = builtins.__dict__['ngettext']
KeyError: 'ngettext'

Thanks Videl, Scimmia and loqs for your help.

Offline

Board footer

Powered by FluxBB