ImportError: No module named HTMLParser

M

Mike

Hi

I'm getting the above message on a server installation (2.4) of Python.
I don't get the error using my script on my own machine. I'm trying to
use the non-sgmllib one - the standard HTMLParser but it won't import
on the server. How can I go about checking which file should reside
where?

I'm a Python newbie so please bear with me.

Thanks,
Mike
 
F

Fredrik Lundh

Mike said:
I'm getting the above message on a server installation (2.4) of Python.
I don't get the error using my script on my own machine. I'm trying to
use the non-sgmllib one - the standard HTMLParser but it won't import
on the server. How can I go about checking which file should reside
where?

are you sure you're running 2.4 on the server ? (or rather, that your
Python programs are picking up the 2.4 installation, and not some older
version).

did you do the installation yourself ? have you checked the contents of
the sys.path variable ? does the output from

python -v -c "import HTMLParser"

look correct (i.e. does it search for stuff where you actually installed it) ?

</F>
 
M

Mike

Thanks - it turned out that the Python installation on our vendor's
server is a cut-down one. I have had to place the HTMLParser source in
a package off the a sys.path directory and import it from there - it
now works.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top