Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python install xmlrpclib

I'm in a virtualenv and trying to run a script I get the following:

Traceback (most recent call last):
  File "blah.py", line 15, in <module>
    from xmlrpc import server
ImportError: No module named xmlrpc

Ok so that seems that I need xmlrpc, which I'm assuming means I need xmlrpclib

So I try that:

(env) ❯❯❯ pip2.7 install xmlrpclib                                                                
Collecting xmlrpclib
  Could not find a version that satisfies the requirement xmlrpclib (from versions: )
  Some externally hosted files were ignored as access to them may be unreliable (use --allow-external xmlrpclib to allow).
No matching distribution found for xmlrpclib

Ok, so then I'll try the --allow-external to get it working:

(env) ❯❯❯ pip2.7 install --allow-external xmlrpclib                                                                                                                           ⏎ ◼
You must give at least one requirement to install (see "pip help install")

Not sure why xmlrpclib isn't seen to be a valid argument?

like image 354
edumike Avatar asked Aug 21 '15 07:08

edumike


2 Answers

The answer is that the module xmlrpc is part of python3, not python2.x

details: https://docs.python.org/3/library/xmlrpc.server.html

Should already be installed, just go ahead and use it.

like image 170
edumike Avatar answered Sep 24 '22 12:09

edumike


I'm not sure if pip provides this lib. Just download xmlrpclib from here http://effbot.org/downloads/#xmlrpclib, unpack it and then run:

python3 setup.py build
python3 setup.py install
like image 41
Nhor Avatar answered Sep 25 '22 12:09

Nhor