No module named urllib

Carsten Haese carsten at uniqsys.com
Tue May 8 09:55:01 EDT 2007


On Tue, 2007-05-08 at 06:19 -0700, HMS Surprise wrote:
> Thanks for posting. How does one ensure (or even detect) that their
> libraries are compatible?

You ensure that by taking the library from the version of Python that
you're running.

> I loaded this library as part of Python 2.5.

That's too new. Since you're using Jython, you're running either 2.1 or
2.2 depending on whether you've installed the stable version or the beta
version. Go grab a Python distribution of the correct version and get
the modules you need from there. Note this, though:

http://www.jython.org/Project/installation.html#can-t-access-standard-python-modules :
"Not all the modules form CPython is available in Jython. Some modules
require a C language dynamic link library that doesn't exists in java.
Other modules are missing from Jython just because nobody have had a
need for it before and no-one have tested the CPython module with
Jython. If you discover that you are missing a module, try to copy
the .py file from a CPython distribution to a directory on your Jython
sys.path. If that works you are set. If it doesn't work, try asking on
jython-users mailing list."

To summarize, you could be looking at a rather deep rabbit hole of
possibly unsatisfiable dependencies.

To summarize the summary, are you sure you need to use Jython instead of
standard CPython?

Good luck,

-- 
Carsten Haese
http://informixdb.sourceforge.net





More information about the Python-list mailing list