Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 510688 - net-misc/electrum-1.9.8 USE=-qt4 - electrum: ImportError: No module named qt
Summary: net-misc/electrum-1.9.8 USE=-qt4 - electrum: ImportError: No module named qt
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Anthony Basile
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 541538
  Show dependency tree
 
Reported: 2014-05-18 21:32 UTC by leonbaum2
Modified: 2015-11-08 18:07 UTC (History)
9 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
electrum-1.9.8.ebuild.patch (electrum-1.9.8.ebuild.patch,571 bytes, patch)
2014-10-29 11:35 UTC, Sorrow
Details | Diff
My modified diff against electrum-1.9.8 (electrum-1.9.8.ebuild.diff,1.21 KB, patch)
2015-01-08 17:06 UTC, Dmitri Bogomolov
Details | Diff
electrum-1.9.8-gtk.patch (electrum-1.9.8-gtk.patch,691 bytes, patch)
2015-01-08 17:10 UTC, Dmitri Bogomolov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description leonbaum2 2014-05-18 21:32:35 UTC
If I emerge electrum with USE=-qt4, I get an error because it still depends on the python qt module:

$ electrum
Traceback (most recent call last):
  File "/usr/lib/python-exec/python2.7/electrum", line 190, in <module>
    gui = __import__('electrum_gui.' + gui_name, fromlist=['electrum_gui'])
ImportError: No module named qt
Comment 1 mephinet 2014-08-14 11:15:54 UTC
The issue is caused by this line in the electrum main script:

    if cmd == 'gui':
        gui_name = config.get('gui', 'classic')
        if gui_name in ['lite', 'classic']:
            gui_name = 'qt'

I guess, when using -qt, the default for the gui should be "gtk" instead of "classic". if gtk is deactivated as well, we should probably fall back to "text".

Work-around: specify --gui=gtk on the command line.
Comment 2 ta2002 2014-10-28 07:53:39 UTC
(In reply to mephinet from comment #1)

> Work-around: specify --gui=gtk on the command line.

Doesn't work for me:

$ electrum --gui=gtk
Traceback (most recent call last):
  File "/usr/lib/python-exec/python2.7/electrum", line 190, in <module>
    gui = __import__('electrum_gui.' + gui_name, fromlist=['electrum_gui'])
  File "/usr/lib64/python2.7/site-packages/electrum_gui/gtk.py", line 23, in <module>
    import gi
ImportError: No module named gi
Comment 3 Sorrow 2014-10-28 13:17:55 UTC
(In reply to throw_away_2002 from comment #2)
It's because you do not have installed dev-python/pygobject:3. THe ebuild needs to be fixed since electrum switched to GTK3.
Comment 4 ta2002 2014-10-28 19:04:40 UTC
So you are saying that gtk+3 is required, even though it installs fine (but doesn't run) with gtk+2 (no gtk+3 on the machine at all)?

So do I need gkt+3 or pygobject:3 or both?
Comment 5 Sorrow 2014-10-29 02:49:13 UTC
(In reply to throw_away_2002 from comment #4)
> So do I need gkt+3 or pygobject:3 or both?
Actually you need both. There are wrong dependencies in the ebuild.
Comment 6 Anthony Basile gentoo-dev 2014-10-29 11:12:38 UTC
I have not had time to give electrum any love.  Does someone have a patch for this?
Comment 7 Sorrow 2014-10-29 11:35:26 UTC
Created attachment 387712 [details, diff]
electrum-1.9.8.ebuild.patch

(In reply to Anthony Basile from comment #6)
Here you are :)
Comment 8 Dmitri Bogomolov 2015-01-08 16:23:29 UTC
(In reply to Eternal Sorrow from comment #7)
> Created attachment 387712 [details, diff] [details, diff]
> electrum-1.9.8.ebuild.patch
> 
> (In reply to Anthony Basile from comment #6)
> Here you are :)

This didn't help me.
Comment 9 Dmitri Bogomolov 2015-01-08 16:24:12 UTC
(In reply to mephinet from comment #1)

> Work-around: specify --gui=gtk on the command line.

Traceback (most recent call last):
  File "/usr/lib/python-exec/python2.7/electrum", line 204, in <module>
    gui.main(url)
  File "/usr/lib64/python2.7/site-packages/electrum_gui/gtk.py", line 1310, in main
    action = self.restore_or_create()
  File "/usr/lib64/python2.7/site-packages/electrum_gui/gtk.py", line 1351, in restore_or_create
    return restore_create_dialog()
  File "/usr/lib64/python2.7/site-packages/electrum_gui/gtk.py", line 90, in restore_create_dialog
    flags=Gtk.DialogFlags.MODAL|Gtk.DialogFlags.NO_SEPARATOR, 
AttributeError: type object 'GtkDialogFlags' has no attribute 'NO_SEPARATOR'
Comment 10 Dmitri Bogomolov 2015-01-08 17:06:29 UTC
Created attachment 393468 [details, diff]
My modified diff against electrum-1.9.8

I fixed the spaces and added a patch which helped me with my gtk+-3.12.2.
Comment 11 Dmitri Bogomolov 2015-01-08 17:10:19 UTC
Created attachment 393470 [details, diff]
electrum-1.9.8-gtk.patch

Gtk version requires clarification. With my 3.12.2 I had the error shown in Comment 9.
Comment 12 Anthony Basile gentoo-dev 2015-02-14 13:19:26 UTC
(In reply to Dmitri Bogomolov from comment #11)
> Created attachment 393470 [details, diff] [details, diff]
> electrum-1.9.8-gtk.patch
> 
> Gtk version requires clarification. With my 3.12.2 I had the error shown in
> Comment 9.

I've been waiting for upstream's next release but this isn't going to happen anytime soon.

@everyone, are Dmitri's patches working for you?  If so, I'll just apply.

@Dmitri. FYI, those patches won't apply cleanly anymore because of a fix to 1.9.8.  I can clean them up at my end, but you may want to know for yourself and others, eg, if you putting them in your /etc/portage/patches directory.
Comment 13 Luke-Jr 2015-03-01 08:04:46 UTC
Fixed this in the overlay.
Comment 14 Anthony Basile gentoo-dev 2015-03-05 21:58:19 UTC
This should be fixed with 1.9.8-r1.  Please test and reopen if there's a problem.
Comment 15 Alexey Mishustin 2015-11-08 17:43:59 UTC
I have the same problem with net-misc/electrum-2.1.1:

$ electrum -o -g qt
Error: Cannot read config file.
Traceback (most recent call last):
  File "/usr/lib/python-exec/python2.7/electrum", line 234, in <module>
    gui = __import__('electrum_gui.' + gui_name, fromlist=['electrum_gui'])
  File "/usr/lib64/python2.7/site-packages/electrum_gui/qt/__init__.py", line 33, in <module>
    from PyQt4.QtGui import *
ImportError: No module named QtGui

# equery uses electrum | grep '+'
+cli
+fiat
+linguas_ru_RU
+ncurses
+python_targets_python2_7
+qt4
Comment 16 Alexey Mishustin 2015-11-08 18:07:31 UTC
And with gtk3 instead of qt4 it is launching OK.