从命令行使用Electrum时没有模块名称'xmlrpclib'

时间:2017-05-03 02:46:26

标签: python python-import xmlrpclib

我刚刚从Electrum.org的命令行安装了一个比特币钱包

继承人我是如何在我的用户帐户目录中安装它的./ home / user /...

container-fluid

并且没有任何问题安装。

当我尝试使用命令行运行软件时 sudo pip3 install https://download.electrum.org/2.8.2/Electrum-2.8.2.tar.gz 或者如果我尝试electrum,我会收到此导入错误

(继承人的文件http://docs.electrum.org/en/latest/cmdline.html

electrum help

如果你想复制它,那么继续追溯

ImportError: No module named 'xmlrpclib'

我已经完成了

File "/usr/local/bin/electrum", line 71, in check_imports import jsonrpclib File "/usr/local/lib/python3.5/dist-packages/jsonrpclib/__init__.py", line 5, in <module> from jsonrpclib.jsonrpc import Server, MultiCall, Fault File "/usr/local/lib/python3.5/dist-packages/jsonrpclib/jsonrpc.py", line 50, in <module> from xmlrpclib import Transport as XMLTrasnport

sudo apt-get update

sudo apt-get upgrade

但没有用。

如果有人能够提供一些非常感激的见解。

1 个答案:

答案 0 :(得分:6)

  

xmlrpclib模块已在Python中重命名为xmlrpc.client   3。

所以,如果你想使用xmlrpclib

import xmlrpclib

将其替换为:

from xmlrpc import client

此项目已更新两年,因此您可以找到此文件/usr/local/lib/python3.5/dist-packages/jsonrpclib/jsonrpc.py并更改

from xmlrpclib import Transport as XMLTransport
from xmlrpclib import SafeTransport as XMLSafeTransport
from xmlrpclib import ServerProxy as XMLServerProxy
from xmlrpclib import _Method as XML_Method

from xmlrpc.client import Transport as XMLTransport
from xmlrpc.client import SafeTransport as XMLSafeTransport
from xmlrpc.client import ServerProxy as XMLServerProxy
from xmlrpc.client import _Method as XML_Method 

您也可以使用2to3转换来源:

2to3 -w jsonrpc.py

然后改变

line 168 from http.client import HTTP, HTTPConnection
line 186     class UnixHTTP(HTTP):

line 168 from http.client import HTTPConnection
line 186     class UnixHTTP(HTTPConnection):

希望这有帮助。