ImportError: No module named HTMLParser

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mike

    #1

    ImportError: No module named HTMLParser

    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

  • Fredrik Lundh

    #2
    Re: ImportError: No module named HTMLParser

    Mike wrote:
    [color=blue]
    > 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?[/color]

    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>



    Comment

    • Mike

      #3
      Re: ImportError: No module named HTMLParser

      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.

      Comment

      Working...