Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install xmlrpclib in python 3.4?

When I am trying to install xmlrpclib, I am getting following error in python version 3.4

Downloading/unpacking xmlrpclib Could not find any downloads that satisfy the requirement xmlrpclib Some externally hosted files were ignored (use --allow-external xmlrpclib to allow). Cleaning up... No distributions at all found for xmlrpclib Storing debug log for failure in /home/shiva/.pip/pip.log

How to install xmlrpclib in python 3.4 ?

like image 990
James Avatar asked Sep 05 '14 00:09

James


People also ask

How do I enable Allow_none on XML-RPC?

In your server class, add allow_none=True to your SimpleXMLRPCServer instantiation. The allow_none and encoding parameters are passed on to xmlrpc. client and control the XML-RPC responses that will be returned from the server.

What is XML-RPC standard?

XML-RPC is a Remote Procedure Call method that uses XML passed via HTTP as a transport. With it, a client can call methods with parameters on a remote server (the server is named by a URI) and get back structured data. xmlrpc is a package that collects server and client modules implementing XML-RPC.

What is ServerProxy in Python?

ServerProxy ObjectsA ServerProxy instance has a method corresponding to each remote procedure call accepted by the XML-RPC server. Calling the method performs an RPC, dispatched by both name and argument signature (e.g. the same method name can be overloaded with multiple argument signatures).

How does XML-RPC work?

In XML-RPC, a client performs an RPC by sending an HTTP request to a server that implements XML-RPC and receives the HTTP response. A call can have multiple parameters and one result. The protocol defines a few data types for the parameters and result. Some of these data types are complex, i.e. nested.


2 Answers

xmlrpclib is part of the standard library in Python 2.x. It's not a package that you need to install.

In Python 3.x you can import it from xmlrpc instead: https://docs.python.org/3/library/xmlrpc.html. You can import the client from xmlrpc.client: https://docs.python.org/3/library/xmlrpc.client.html#module-xmlrpc.client.

like image 136
Simeon Visser Avatar answered Sep 20 '22 11:09

Simeon Visser


import xmlrpc.client as xc

enter code hereenter code here
client = xc.Server('http://' + host + ':' + port + '/RPC2')
client.supervisor.getState()
client.supervisor.getProcessInfo('process name')
like image 26
focus zheng Avatar answered Sep 18 '22 11:09

focus zheng