[python-win32] Module not found weirdness
rwupole at msn.com
Wed Sep 20 01:26:31 CEST 2006
Derick Van Niekerk wrote:
> When I execute the code here
> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/355593 I get the
> following traceback:
> Traceback (most recent call last):
> File "C:\Documents and Settings\Derick\Desktop\test.py", line 73, in ?
> frame = TestFrame ()
> File "C:\Documents and Settings\Derick\Desktop\test.py", line 23, in
> self.nextWnd = win32clipboard.SetClipboardViewer (self.hwnd)
> pywintypes.error: (126, 'SetClipboardViewer', 'The specified module could
> not be found.')
> Script terminated.
> I have run dependency walker and found that all the dlls load fine. The
> other win32clipboard functions work fine as well, like getting and setting
> the clipboard contents. I have found that SetClipboardViewer ( self.hwnd)
> should be in user32.dll but I have the same version installed as on my PC at
> work where the program runs without a problem.
> The strange thing is that all the other functions I tried work fine, which
> would indicate that I might be using an old version of some dll - the
> function might not exist in the module dll I'm using. user32 doesn't seem at
> fault though since it is the same on both PC's...
> What could be the problem? Google couldn't teach me anything on this problem
> This code doesn't work:
> But this does - even though it uses the same module:
> import win32clipboard as w
> import win32con
> def getText():
> return d
> def setText(aType,aString):
Since you're getting pywintypes.error rather than an import error,
the function is actually called. Most likely the app that created the
window (wxPython) isn't responding correctory. You might want to
check if you have the same version of wx on both machines.
More information about the Python-win32