ctypes error on Windows

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

    ctypes error on Windows

    I'm working on a script with the most excellent uTibyLib library. The script works just fine on Mac, but on Windows I get this:

    File "findtables.py" , line 82, in cleanHTML
    return str(tidy.parseS tring(decentDoc ))
    File "c:\Python24\Li b\site-packages\tidy\l ib.py", line 207, in parseString
    doc = self._create(** kwargs)
    File "c:\Python24\Li b\site-packages\tidy\l ib.py", line 183, in _create
    doc = _Document()
    File "c:\Python24\Li b\site-packages\tidy\l ib.py", line 135, in __init__
    self.cdoc = _tidy.Create()
    File "c:\Python24\Li b\site-packages\tidy\l ib.py", line 46, in __getattr__
    return getattr(self.li b, name)
    File "C:\Python24\Li b\site-packages\ctypes \__init__.py", line 353, in __getatt
    func = self.__getitem_ _(name)
    File "C:\Python24\Li b\site-packages\ctypes \__init__.py", line 358, in __getite
    func = self._FuncPtr(( name_or_ordinal , self))
    AttributeError: function 'Create' not found


    I do have the tidy.dll installed (if I didn't, I couldn't even import the tidy module).

    Anyone have any ideas to try?

    --
    mhostetl@sdf.lo nestar.org
    SDF Public Access UNIX System - http://sdf.lonestar.org
  • Fredrik Lundh

    #2
    Re: ctypes error on Windows

    Mike Hostetler wrote:
    I'm working on a script with the most excellent uTibyLib library. The script works just fine on Mac, but on Windows I get this:
    >
    File "findtables.py" , line 82, in cleanHTML
    return str(tidy.parseS tring(decentDoc ))
    File "c:\Python24\Li b\site-packages\tidy\l ib.py", line 207, in parseString
    doc = self._create(** kwargs)
    File "c:\Python24\Li b\site-packages\tidy\l ib.py", line 183, in _create
    doc = _Document()
    File "c:\Python24\Li b\site-packages\tidy\l ib.py", line 135, in __init__
    self.cdoc = _tidy.Create()
    File "c:\Python24\Li b\site-packages\tidy\l ib.py", line 46, in __getattr__
    return getattr(self.li b, name)
    File "C:\Python24\Li b\site-packages\ctypes \__init__.py", line 353, in __getatt
    func = self.__getitem_ _(name)
    File "C:\Python24\Li b\site-packages\ctypes \__init__.py", line 358, in __getite
    func = self._FuncPtr(( name_or_ordinal , self))
    AttributeError: function 'Create' not found
    >
    I do have the tidy.dll installed (if I didn't, I couldn't even import the tidy module).
    typing the following into the Python interpreter might give you some
    more clues:
    >>import _tidy
    >>_tidy.__file_ _
    >>dir(_tidy)
    </F>

    Comment

    • Fredrik Lundh

      #3
      Re: ctypes error on Windows

      Fredrik Lundh wrote:
      >I do have the tidy.dll installed (if I didn't, I couldn't even import
      >the tidy module).
      >
      typing the following into the Python interpreter might give you some
      more clues:
      >
      >>import _tidy
      >>_tidy.__file_ _
      >>dir(_tidy)
      or not, since ctypes is involved.

      have you checked for multiple copies of tidy.dll?

      if you have MSVC on your machine, try using "dumpbin /exports" on the
      DLL to check that it really exports the symbols the binding expects.

      </F>

      Comment

      • Thomas Heller

        #4
        Re: ctypes error on Windows

        Fredrik Lundh schrieb:
        Fredrik Lundh wrote:
        >
        >>I do have the tidy.dll installed (if I didn't, I couldn't even import
        >>the tidy module).
        >>
        >typing the following into the Python interpreter might give you some
        >more clues:
        >>
        > >>import _tidy
        > >>_tidy.__file_ _
        > >>dir(_tidy)
        >
        or not, since ctypes is involved.
        >
        have you checked for multiple copies of tidy.dll?
        >
        if you have MSVC on your machine, try using "dumpbin /exports" on the
        DLL to check that it really exports the symbols the binding expects.
        >
        Or use dependencywalke r (google for it).

        Thomas

        Comment

        Working...