libname = ctypes.util.find_library('magic') or ctypes.util.find_library('magic1') should add ctypes.util.find_library('msys-magic-1.dll')