import mymodule, ctypes
#import pygame
foo = ctypes.cdll.MyDll.foo
print 'success'
if i uncomment the import pygame
this fails with WindowsError: [Errno 182] The operating system cannot load %1
. the stack frame is in ctypes python code, trying to load MyDll. win32 error code 182 is ERROR_INVALID_ORDINAL
. if the pygame import is not there, the script runs successfully.
Update: If I run it outside the debugger, the %1 is filled with 'libpng13.dll', which is in the working directory and referenced by MyDll, and pygame is certainly loading some version of libpng. I have no idea how I would resolve this.