ctypes error on Windows

Discussion in 'Python' started by Mike Hostetler, Sep 5, 2008.

  1. 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.parseString(decentDoc))
    File "c:\Python24\Lib\site-packages\tidy\lib.py", line 207, in parseString
    doc = self._create(**kwargs)
    File "c:\Python24\Lib\site-packages\tidy\lib.py", line 183, in _create
    doc = _Document()
    File "c:\Python24\Lib\site-packages\tidy\lib.py", line 135, in __init__
    self.cdoc = _tidy.Create()
    File "c:\Python24\Lib\site-packages\tidy\lib.py", line 46, in __getattr__
    return getattr(self.lib, name)
    File "C:\Python24\Lib\site-packages\ctypes\__init__.py", line 353, in __getatt
    func = self.__getitem__(name)
    File "C:\Python24\Lib\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?

    --

    SDF Public Access UNIX System - http://sdf.lonestar.org
     
    Mike Hostetler, Sep 5, 2008
    #1
    1. Advertising

  2. 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.parseString(decentDoc))
    > File "c:\Python24\Lib\site-packages\tidy\lib.py", line 207, in parseString
    > doc = self._create(**kwargs)
    > File "c:\Python24\Lib\site-packages\tidy\lib.py", line 183, in _create
    > doc = _Document()
    > File "c:\Python24\Lib\site-packages\tidy\lib.py", line 135, in __init__
    > self.cdoc = _tidy.Create()
    > File "c:\Python24\Lib\site-packages\tidy\lib.py", line 46, in __getattr__
    > return getattr(self.lib, name)
    > File "C:\Python24\Lib\site-packages\ctypes\__init__.py", line 353, in __getatt
    > func = self.__getitem__(name)
    > File "C:\Python24\Lib\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>
     
    Fredrik Lundh, Sep 5, 2008
    #2
    1. Advertising

  3. 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>
     
    Fredrik Lundh, Sep 5, 2008
    #3
  4. 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 dependencywalker (google for it).

    Thomas
     
    Thomas Heller, Sep 5, 2008
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Henk Punt
    Replies:
    0
    Views:
    411
    Henk Punt
    Jul 23, 2004
  2. Srijit Kumar Bhadra
    Replies:
    6
    Views:
    2,164
    Paul Du Bois
    Mar 26, 2005
  3. looping
    Replies:
    0
    Views:
    289
    looping
    Nov 14, 2006
  4. Noralf Trønnes
    Replies:
    4
    Views:
    291
    Noralf Trønnes
    May 9, 2007
  5. Replies:
    0
    Views:
    519
Loading...

Share This Page