Electrum: Cannot upgrade or install new versions in linux

Created on 22 Jan 2019  ยท  24Comments  ยท  Source: spesmilo/electrum

Command: sudo apt-get install python3-setuptools python3-pyqt5 python3-pip

  • works fine - all install.

Command: sudo python3 -m pip install https://download.electrum.org/3.3.2/Electrum-3.3.2.tar.gz#egg=electrum[fast]

Result:

The directory '/home/fred/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/fred/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting electrum[fast] from https://download.electrum.org/3.3.2/Electrum-3.3.2.tar.gz#egg=electrum[fast]
  Downloading https://download.electrum.org/3.3.2/Electrum-3.3.2.tar.gz (8.9MB)
    100% |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 8.9MB 133kB/s 
    Complete output from command python setup.py egg_info:
    Error: Electrum requires Python version >= 3.6.1...

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-osck464i/electrum/
You are using pip version 8.1.1, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

Using sudo -H as suggested changes nothing.
Using "pip install --upgrade pip" as suggested:

/usr/local/lib/python2.7/dist-packages/pip-18.1-py2.7.egg/pip/_vendor/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
  warnings.warn(warning, RequestsDependencyWarning)
Requirement already up-to-date: pip in /usr/local/lib/python2.7/dist-packages/pip-18.1-py2.7.egg (18.1)

... and nothing changes trying to install after that

Trying to run or install from sources:
Command: python3 run_electrum
Output:

File "run_electrum", line 53
    sys.exit(f"Error: {str(e)}. Try 'sudo python3 -m pip install <module-name>'")
                                                                               ^
SyntaxError: invalid syntax

Command: sudo python3 -m pip install .[fast]
Output:

Processing /home/fred/Electrum-3.3.2
    Complete output from command python setup.py egg_info:
    Error: Electrum requires Python version >= 3.6.1...

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-wrs8v_10-build/
You are using pip version 8.1.1, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
OS-linux ๐Ÿง question โ“

All 24 comments

I should add:
python3 -V
Python 3.7.1

when upgading pip, use pip3 not pip

Does not change anything.

what exactly did you do?

pip3 install --upgrade pip

Which Linux distribution and version is this on?
How did you install python3.7?

Mint 18.1
py3.7 via jonathonf PPA.

Does not change anything.

you cannot possibly have gotten this message with pip3:

Requirement already up-to-date: pip in /usr/local/lib/python2.7/dist-packages/pip-18.1-py2.7.egg (18.1)

please add details

It's indeed an invalid syntax error for Python 3.5 (tested on Ubuntu 16.04). Fixed by upgrading to 3.6 (on 18.04).

I ran into this problem today. This is what fixed it:

$ sudo apt-get install software-properties-common
$ sudo add-apt-repository ppa:deadsnakes/ppa
$ sudo apt-get update
$ sudo apt-get install python3.6
$ sudo python3.6 -m pip install https://download.electrum.org/3.3.3/Electrum-3.3.3.tar.gz#egg=electrum[fast]

Edit: Ok so the above enabled me to complete the install, but upon running Electrum I have a new error message:

$ 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'

Why are you using (and trusting) such old versions of Linux Mint (18.1) and Ubuntu (16.04 LTS) with Bitcoin wallets ? Combined with a PPA with a clear warning is not the best choice:
"Disclaimer: there's no guarantee of timely updates in case of security problems or other issues. If you want to use them in a security-or-otherwise-critical environment (say, on a production server), you do so at your own risk."

Upgrade to the latest (non-LTS Ubuntu) versions if you must use packages from your distribution. That's the whole point of using GNU/Linux.

Note: the next version of Electrum will most likely also be released as an AppImage (https://github.com/spesmilo/electrum/pull/5042). Hopefully this will help.

sudo add-apt-repository ppa:deadsnakes/ppa
ModuleNotFoundError: No module named 'PyQt5.QtGui'

You need pyqt5 for the correct version of python3. If you install python3 from outside the packages distributed by your Linux distro; the pyqt5 distributed by your distro will not be for that version of python3.

Sorry to be a pain, but I'm dealing with this too. Trying to install 3.3.3 to patch the recent vulnerabilities, but am on raspbian which came with python3.5. Installed python3.7.1 following this guide: https://www.scivision.co/compile-install-python-beta-raspberry-pi/. Now I get this:

$ python3 --version
Python 3.7.1
$ python3
Python 3.7.1 (default, Dec 31 2018, 15:50:08)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> quit()
$ sudo python3 -m pip install https://download.electrum.org/3.3.3/Electrum-3.3.3.tar.gz#egg=electrum[fast]
Collecting electrum[fast] from https://download.electrum.org/3.3.3/Electrum-3.3.3.tar.gz#egg=electrum[fast]
  Using cached https://download.electrum.org/3.3.3/Electrum-3.3.3.tar.gz
    Complete output from command python setup.py egg_info:
    Error: Electrum requires Python version >= 3.6.1...

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-qy5xaxik/electrum/
$ sudo python3.7.1 -m pip install https://download.electrum.org/3.3.3/Electrum-3.3.3.tar.gz#egg=electrum[fast]
sudo: python3.7.1: command not found

also maybe of interest:

$ which pip
/usr/local/bin/pip
$ which pip3
/home/admin/.local/bin//pip3
$ which python3
/home/admin/.local/bin//python3

any way to fix this or I just have to deal with the old version for now? I'm on a raspberry pi (armv7), so it doesn't appear the following will help

Note: the next version of Electrum will most likely also be released as an AppImage (#5042). Hopefully this will help.

@MrPaz
x python3.7.1
o python3.7

sudo python3.7 -m pip install https://download.electrum.org/3.3.3/Electrum-3.3.3.tar.gz#egg=electrum[fast]

and..... pip should also be reinstalled with python 3.7
curl -kL https://bootstrap.pypa.io/get-pip.py | python3.7

reinstalled pip as instructed and it was successful. Unfortunately still getting this:

 $ sudo python3.7 -m pip install https://download.electrum.org/3.3.3/Electrum-3.3.3.tar.gz#egg=electrum[fast]
sudo: python3.7: command not found

ok. I think that pip probably remains python 3.6.

curl -kL https://bootstrap.pypa.io/get-pip.py | python3
sudo python3 -m pip install https://download.electrum.org/3.3.3/Electrum-3.3.3.tar.gz#egg=electrum[fast]
 $ curl -kL https://bootstrap.pypa.io/get-pip.py | python3
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1662k  100 1662k    0     0  1384k      0  0:00:01  0:00:01 --:--:-- 1385k
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting pip
  Using cached https://files.pythonhosted.org/packages/d7/41/34dd96bd33958e52cb4da2f1bf0818e396514fd4f4725a79199564cd0c20/pip-19.0.2-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 19.0.2
    Uninstalling pip-19.0.2:
      Successfully uninstalled pip-19.0.2
Successfully installed pip-19.0.2
$ sudo python3 -m pip install https://download.electrum.org/3.3.3/Electrum-3.3.3.tar.gz#egg=electrum[fast]
Collecting electrum[fast] from https://download.electrum.org/3.3.3/Electrum-3.3.3.tar.gz#egg=electrum[fast]
  Using cached https://download.electrum.org/3.3.3/Electrum-3.3.3.tar.gz
    Complete output from command python setup.py egg_info:
    Error: Electrum requires Python version >= 3.6.1...

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-96ol707g/electrum/

:(

Why are you using (and trusting) such old versions of Linux Mint (18.1) and Ubuntu (16.04 LTS) with Bitcoin wallets ?

Ubuntu 16.04 LTS is not โ€œoldโ€. It is supported by Canonical with security and maintenance updates until April 2021. So it's still a perfectly reasonable version for someone to be using.

I'd certainly want to be cautious about PPAs, though.

Upgrade to the latest (non-LTS Ubuntu) versions if you must use packages from your distribution.

Non-LTS releases have a very short lifespan of support. That's the whole point of the LTS releases. Nor are bleeding-edge versions of software automatically more secure than older, stable but well-maintained ones.

At any rate, using the appimage seems to work on my distro which only provides Python 3.5.

Suggesting PPAs is dangerous that should not be allowed in the thread case someone actually uses it without reading.

Probably should just delete or edit that post.

Also App image is not ideal either, why not just update your dependencies and stop using old versions which could contain potential security issues?

@ticalc-travis Ubuntu 16.04 LTS is ANCIENT when considered for any Bitcoin environment, specially desktop applications.
I wish Bitcoin wallet developers had the resources to properly package and backport fixes to LTS version while following protocol changes and additions, sadly they don't - but you're welcome to take your own informed decisions and ignore advice here. I am just hoping it's for your own use and you're not "helping" others like this.

@MagicFab Nope, just personal use: I happened to dig up an old wallet of mine that I could remember little about and just needed to find and get a client working long enough to check on its state and balance. It's just that the way your last post was worded made me think there might have been a possible misunderstanding of how some distros worked, and I wanted to clarify. But lacking resources to package for every distro and dependency version is understandable.

Yes, ideally I'd always be running the newest distro version available the instant it comes out every time, but this is a high time and effort cost due to the number of (unrelated) items I need to have working on the machine, all of which could be affected by newer software/libraries having breaking changes that require research and reconfiguration to fix. So there has to be a practical compromise on how often I can do a complete distro change-out. :-)

Is there a workaround for this? I am trying to install this on a fresh debian and it gives the same error as described here. Is this not going to be fixed anywhen soon? How is this app usable? Only windows and mac?

@dotbanana What error are you getting specifically?

The minimum required Python version is 3.6.1. No we are not going to lower this.
If you are indeed on modern debian (latest stable at least), that has python 3.7.
For workarounds, see https://github.com/spesmilo/electrum-docs/blob/master/faq.rst#electrum-requires-recent-python-my-linux-distribution-does-not-yet-have-it-what-now

Was this page helpful?
0 / 5 - 0 ratings