2016-07-29 12 views
1

Ich hatte vorher 2.7 Python installiert und Anrufe wie diese machen:Python jsonrpclib funktioniert nicht nach dem Upgrade auf Python 3.5.2

api = jsonrpclib.Server('my host') 
api.someFunctionCall() 

ich dann auf Python Upgrade 3.5.2 und jetzt, wenn ich den Code oben ausgeführt , ich erhalte diese Mitteilung:

Traceback (most recent call last): 
    File "C:\login\login.py", line 1, in <module> 
    import jsonrpclib 
File "C:\Python3.5.2\lib\site-packages\jsonrpclib\__init__.py", line 5, in <module> 
from jsonrpclib.jsonrpc import Server, MultiCall, Fault 
ImportError: No module named 'xmlrpclib' 

ich meine Installation überprüft und ich habe in der Tat die xmlrpc lib:

c:\Python3.5.2\Lib\xmlrpc 

Was mache ich falsch?

+0

wird es in Python 3 unterstützt? –

Antwort

3

Python 3.x hat das xmlrpclib-Modul verlagert. Per :

"Das xmlrpclib-Modul wurde in Python 3 in xmlrpc.client umbenannt. Das 2to3-Tool passt Importe automatisch an, wenn Sie Ihre Quellen in Python 3 konvertieren."

Es sieht so aus, als ob der Autor von jsonrpclib ein offenes Problem für die Python 3-Unterstützung hat, aber in einem Jahr nicht geantwortet oder Pull-Requests ausgeführt hat. Vielleicht möchten Sie die jsonrpclib-pelix fork einen Blick für Python 3-Unterstützung geben.

+0

Ich werde einen Blick darauf werfen. Danke, Scullin. –