hello! I can't seem to get Electrum 3.3.1 to start. this is the message. I'm on Debian / Cinnamon. any ideas?
```
viral@lucy:~$ electrum -v
[SimpleConfig] electrum directory /home/viral/.electrum
[p] registering hardware coldcard: ('hardware', 'coldcard', 'Coldcard Wallet')
[p] registering hardware digitalbitbox: ('hardware', 'digitalbitbox', 'Digital Bitbox wallet')
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/electrum/plugin.py", line 76, in load_plugins
spec.loader.exec_module(module)
File "
File "
File "/usr/local/lib/python3.6/site-packages/electrum/plugins/hw_wallet/__init__.py", line 1, in
from .plugin import HW_PluginBase
SystemError: Parent module 'electrum.plugins.hw_wallet' not loaded, cannot perform relative import
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/bin/electrum", line 337, in
plugins = init_plugins(config, config.get('gui', 'qt'))
File "/usr/local/bin/electrum", line 250, in init_plugins
return Plugins(config, gui_name)
File "/usr/local/lib/python3.6/site-packages/electrum/util.py", line 378, in
return lambda args, *kw_args: do_profile(args, kw_args)
File "/usr/local/lib/python3.6/site-packages/electrum/util.py", line 374, in do_profile
o = func(args, *kw_args)
File "/usr/local/lib/python3.6/site-packages/electrum/plugin.py", line 64, in __init__
self.load_plugins()
File "/usr/local/lib/python3.6/site-packages/electrum/plugin.py", line 78, in load_plugins
raise Exception(f"Error pre-loading {full_name}: {repr(e)}") from e
Exception: Error pre-loading electrum.plugins.hw_wallet: SystemError("Parent module 'electrum.plugins.hw_wallet' not loaded, cannot perform relative import",)```
Is this debian testing?
How exactly did you install electrum?
I will try to reproduce if you provide reasonable instructions.
debian stable. I had to build Python3.6 from source. was there maybe a different library I also needed to build with it?
I tried both
sudo apt-get install python3-setuptools python3-pyqt5 python3-pip
sudo python3 -m pip install https://download.electrum.org/3.3.1/Electrum-3.3.1.tar.gz#egg=electrum[fast]
and the install from Python sources
Download and untar Electrum-3.3.1.tar.gz
In the electrum directory, run: 'python3 run_electrum'
To install it on your system, run: 'sudo python3 -m pip install .[fast]'
both have same result
I have a similar problem that Electrum 3.3.1 does not start under Ubuntu 18.04. The error in the console is:
Traceback (most recent call last):
File "/usr/local/bin/electrum", line 68, in
from electrum import util
File "/usr/local/lib/python3.6/dist-packages/electrum/__init__.py", line 3, in
from .wallet import Synchronizer, Wallet
File "/usr/local/lib/python3.6/dist-packages/electrum/wallet.py", line 53, in
from .keystore import load_keystore, Hardware_KeyStore
File "/usr/local/lib/python3.6/dist-packages/electrum/keystore.py", line 35, in
from .plugins import run_hook
ImportError: cannot import name 'run_hook'
@dgyg based on line numbers, that does not seem like a recent version of Electrum...
it could be 3.1.3 maybe.
https://github.com/spesmilo/electrum/blob/3.1.3/lib/keystore.py#L35
Try uninstalling and reinstalling.
python3 -m pip uninstall electrum << multiple times, until it cannot find it, then also try with sudo,
and then reinstall
@SomberNight Many thanks for your fast response. You're right it was an installation issue. Multiple times removing it and then installing it again solved the issue.
(original issue still unsolved)
I just installed Linux Mint which comes with Python3.7. so i'm happy it's working here now. My guess is I needed to build some of the other packages from source too, not just Python3.6.
I have the same issue on Debian 9.6. Here's how to reproduce it on Debian Stable 9.6 with XFCE.
Python ver. on Debian Stable is 2.7.13 therefore a new version needs to be compiled and installed. I followed these steps to install a new Python version 3.6.1: https://unix.stackexchange.com/questions/332641/how-to-install-python-3-6
After successful Python installation I installed Electrum with the following command:
/usr/local/bin/python3.6 -m pip install https://download.electrum.org/3.3.2/Electrum-3.3.2.tar.gz#egg=electrum[fast]
Electrum 3.3.2 installation is successful but it won't start because of the error that is reported in the first message.
I think that Python3.6 that you built has it's own dependencies that are not getting met. it's not as simple as just building Python3.6 from source. there are like 5 other things you also have to build from source but I'm not sure what they are so I think it's easiest to just upgrade to Debian testing or what I did was just install Linux Mint 19.1 which includes all the latest required dependencies
Upgrading OS from stable to testing just because of this is not something I'm going to do. I'm happy with Debian Stable. I will have to just install a newer version on Virtual Machine for this one purpose only but it would be nice to have it working on Stable.
I have the same issue in Linux 18.3, after installing Python 3.6 and installing Electrum, I see this error when I run electrum:
$ electrum
Traceback (most recent call last):
File "/usr/local/bin/electrum", line 339, in <module>
d.init_gui(config, plugins)
File "/usr/local/lib/python3.6/dist-packages/electrum/daemon.py", line 326, in init_gui
gui = __import__('electrum.gui.' + gui_name, fromlist=['electrum'])
File "/usr/local/lib/python3.6/dist-packages/electrum/gui/qt/__init__.py", line 37, in <module>
from PyQt5.QtGui import *
ModuleNotFoundError: No module named 'PyQt5.QtGui'
I tried installing PyQt5 and that did not resolve the error. The electrum.org site currently lacks documentation about what dependencies I need that are seem to be missing.
Edit: Trying ./run_electrum results in this error:
$ ./run_electrum
File "./run_electrum", line 53
sys.exit(f"Error: {str(e)}. Try 'sudo python3 -m pip install <module-name>'")
^
SyntaxError: invalid syntax
sudo apt-get install python3-setuptools python3-pyqt5 python3-pip
@the-metalworker you need at least python 3.6; and you also need pyqt5 for that version of python.
If you e.g. compile python 3.6 yourself, and use apt-get to install python3-pyqt5, then python3-pyqt5 will not be for whatever version of python you compiled but for the version your Linux distro ships.
The next release of Electrum will also be available as an AppImage (https://github.com/spesmilo/electrum/pull/5042) to help with these struggles.
All problems in this issue seem to be due to mixing python/dependency versions; not much else to say.
Closing.
Most helpful comment
Upgrading OS from stable to testing just because of this is not something I'm going to do. I'm happy with Debian Stable. I will have to just install a newer version on Virtual Machine for this one purpose only but it would be nice to have it working on Stable.