Electrum: No module named 'xmlrpclib'

Created on 4 Dec 2017  ยท  14Comments  ยท  Source: spesmilo/electrum

Debian Testing with XFCE 4.12.1
Python 3.6.3
Electrum-3.0.2 (via pip3)
Error: No module named 'xmlrpclib'. Try 'sudo pip install '

Most helpful comment

Thanks this worked.

sudo pip3 uninstall jsonrpclib sudo pip3 install jsonrpc

All 14 comments

I got the same issue.
also tried

romano@arch ๎‚ฐ ~ ๎‚ฐ sudo pip install xmlrpclib
โœ˜ romano@arch ๎‚ฐ ~ ๎‚ฐ pip install xmlrpc
Collecting xmlrpc
Could not find a version that satisfies the requirement xmlrpc (from versions: )
No matching distribution found for xmlrpc

and client

โœ˜ romano@arch ๎‚ฐ ~ ๎‚ฐ pip install xmlrpc.client
Collecting xmlrpc.client
Could not find a version that satisfies the requirement xmlrpc.client (from versions: )
No matching distribution found for xmlrpc.client

Electrum since version 3.0 does not depend on xmlrpclib. Earlier versions used it. It came with jsonrpclib for python2; Electrum now uses jsonrpclib-pelix for python3.

Have you both downloaded tarballs via pip from the official site?
Have you looked at other similar issues? E.g. if either of you is running from source, maybe try https://github.com/spesmilo/electrum/issues/2825#issuecomment-326484842

@ntilotta Have you managed to resolve this?

Thanks this worked.

sudo pip3 uninstall jsonrpclib sudo pip3 install jsonrpc

reopening; might be worth investigating if the jsonrpc package is better than jsonrpclib-pelix

The two packages:

jsonrpclib-pelix
https://pypi.python.org/pypi/jsonrpclib-pelix/
https://github.com/tcalmant/jsonrpclib/

jsonrpc
https://pypi.python.org/pypi/jsonrpc/1.2
https://github.com/NCMI/jsonrpc


It seems to me that jsonrpc does not officially support python3 (though it seemed to work?), and jsonrpclib-pelix might be more actively maintained; so I think we can keep using jsonrpclib-pelix.

this issue still persists on fresh install:
Error: No module named 'xmlrpclib'. Try 'sudo pip install <module-name>'

followed the instruction as of latest 3.0.5 release on Ubuntu 16.04:

sudo -H pip3 install https://download.electrum.org/3.0.5/Electrum-3.0.5.tar.gz
Collecting https://download.electrum.org/3.0.5/Electrum-3.0.5.tar.gz

  Downloading https://download.electrum.org/3.0.5/Electrum-3.0.5.tar.gz (2.6MB)
    100% |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 2.6MB 7.9kB/s 
Requirement already satisfied: pyaes>=0.1a1 in /usr/local/lib/python3.5/dist-packages (from Electrum==3.0.5)
Collecting ecdsa>=0.9 (from Electrum==3.0.5)
  Downloading ecdsa-0.13-py2.py3-none-any.whl (86kB)
    100% |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 92kB 4.9kB/s 
Requirement already satisfied: pbkdf2 in /usr/local/lib/python3.5/dist-packages (from Electrum==3.0.5)
Requirement already satisfied: requests in /usr/local/lib/python3.5/dist-packages (from Electrum==3.0.5)
Collecting qrcode (from Electrum==3.0.5)
  Downloading qrcode-5.3-py2.py3-none-any.whl
Requirement already satisfied: protobuf in /usr/local/lib/python3.5/dist-packages (from Electrum==3.0.5)
Collecting dnspython (from Electrum==3.0.5)
  Downloading dnspython-1.15.0-py2.py3-none-any.whl (177kB)
    100% |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 184kB 9.6kB/s 
Collecting jsonrpclib-pelix (from Electrum==3.0.5)
  Downloading jsonrpclib_pelix-0.3.1-py2.py3-none-any.whl (40kB)
    100% |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 40kB 11kB/s 
Collecting PySocks>=1.6.6 (from Electrum==3.0.5)
  Downloading PySocks-1.6.8.tar.gz (283kB)
    100% |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 286kB 5.3kB/s 
Requirement already satisfied: six in /usr/lib/python3/dist-packages (from qrcode->Electrum==3.0.5)
Requirement already satisfied: setuptools in /usr/local/lib/python3.5/dist-packages (from protobuf->Electrum==3.0.5)
Building wheels for collected packages: Electrum, PySocks
  Running setup.py bdist_wheel for Electrum ... done
  Stored in directory: /root/.cache/pip/wheels/38/7b/75/00edf93acf4a284bbcab77fee9543674afae696f5fa3812b42
  Running setup.py bdist_wheel for PySocks ... done
  Stored in directory: /root/.cache/pip/wheels/77/f0/00/52f304b7dddcca8fca05ad1226382134ad50ba6c1662d7539e
Successfully built Electrum PySocks
Installing collected packages: ecdsa, qrcode, dnspython, jsonrpclib-pelix, PySocks, Electrum
Successfully installed Electrum-3.0.5 PySocks-1.6.8 dnspython-1.15.0 ecdsa-0.13 jsonrpclib-pelix-0.3.1 qrcode-5.3

i don't have the OLD libraries:

sudo -H pip3 uninstall jsonrpclib
Cannot uninstall requirement jsonrpclib, not installed

what is happening? Thanks!

maybe you installed it in your user directory, not as root

Same issue, I am trying to install on Mac via homebrew. This happens:

electrum --help
Error: No module named 'xmlrpclib'. Try 'sudo pip install <module-name>'

Same issue here. I am trying to install it in the virtual environment that comes with it. It's weird that xmlrpclib is the module name in python 2 (https://docs.python.org/2/library/xmlrpclib.html) and has changed to xmlrpc in python 3 (https://docs.python.org/3/library/xmlrpc.html), but electrum only runs on python 3.

try deleting the packages folder in the electrum root folder, and then
sudo python3 -m pip install .[fast]

Ok, this is what I did with your suggestion (as I understood):

  • deleted env folder (created by electrum-env)
  • run electrum-env
  • activate environment: source env/bin/activate
  • run pip install .[fast]
  • tried to run electrum: ./run_electrum

New error:

Error: Could not import PyQt5 on Linux systems, you may try 'sudo apt-get install python3-pyqt5'

Of course I tried to install it as it says, but it says it's already installed.

while the system python has pyqt5 installed, the one in your venv does not.
you should pip install pyqt5 inside the venv

Yes, I thought that, but it says:

No matching distribution found for pyqt5

Was this page helpful?
0 / 5 - 0 ratings

Related issues

2600box picture 2600box  ยท  5Comments

reardenlife picture reardenlife  ยท  4Comments

juniorjp picture juniorjp  ยท  5Comments

nolith picture nolith  ยท  5Comments

dl3br picture dl3br  ยท  4Comments