[Python] Import error of a .pyd file (AI, leave me alone please; my title is great)

Discussão em 'Python' iniciado por Stack, Outubro 24, 2024.

  1. Stack

    Stack Membro Participativo

    I have a .pyd that I generate with swig. Today, I upgraded from python 3.7 to 3.11, and it stopped loading.

    I renamed my file to foo.pyd. Within the interpreter, I ran import foo. It gives the error

    ImportError: DLL load failed while importing foo: The specified module could not be found.


    Usually, the problem is a missing dependency (.dll). I checked with dlldiag

    https://github.com/adamrehn/dll-diagnostics

    and nothing is missing.

    Moreover, I used winapi to win32api.LoadLibrary( foo.pyd ) and win32api.GetProcAddress( PyInit_foo ). No problem.

    Why doesn't it load? What's up with the useless error message?

    Continue reading...

Compartilhe esta Página