edumike
edumike

Reputation: 3309

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?

Upvotes: 5

Views: 36234

Answers (5)

windlives
windlives

Reputation: 1

Be sure to use the correct interpreter. xmlrpc is part of python3, using python3 interpreter.

Upvotes: 0

Nhor
Nhor

Reputation: 3940

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

Upvotes: 3

edumike
edumike

Reputation: 3309

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.

Upvotes: 9

pocketfullofcheese
pocketfullofcheese

Reputation: 8847

I believe the answer to your question can be found here.

Try adding --allow-unverified to your last command.

EDIT: I think your import statement is wrong. The module is called xmlrpclib, not xmlrpc

Upvotes: 0

Nishant Nawarkhede
Nishant Nawarkhede

Reputation: 8390

If you are using python 2.x then xmlrpclib is part of standard lib. No need of installing it.

Anyway you can download xmlrpclib from http://effbot.org

Upvotes: 2

Related Questions