[Python] Method find_msvcrt in ctype library is returning None because of the version of msvc...

Discussão em 'Python' iniciado por Stack, Julho 25, 2025.

  1. Stack

    Stack Membro Participativo

    I am using a program which uses the library whisper which in turn uses the ctypes library, to transcribe some video audios. I tested in a virtual machine with windows server already configured, and it works well. The difference between my real machine and the virtual machine is in my real machine I installed Python from the website and in virtual machine I installed it using conda, but I think Python has already been installed in this VM, and I really don't know which version I was using. I can't check because some few weeks ago I deleted this VM image.

    When I debug the code, in the method find_library() located in ctypes.util, it checks the compiler version of MSVC that Python was compiled with and returns the MSVC DLL path, and Python 3.12 is compiled with MSVC 14.3, but the method only supports MSVC <= 13. Then, if the version is greater, it will return a None value. I've already tried to force other versions, but it crashes in another part.

    When the None value is returned, the next method will allocate the MSVC DLL library to an object, but it doesn't work because my path is None, and crash the program with the following message:

    C:/Python312/python.exe e:/Repositories/easy-subber/main.py
    Traceback (most recent call last):
    File "e:\Repositories\easy-subber\main.py", line 7, in <module>
    from transcription import transcribe_audio
    File "e:\Repositories\easy-subber\transcription.py", line 1, in <module>
    import whisper
    File "C:\Python312\Lib\site-packages\whisper.py", line 69, in <module>
    libc = ctypes.CDLL(libc_name)
    ^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Python312\Lib\ctypes\__init__.py", line 369, in __init__
    if '/' in name or '\\' in name:
    ^^^^^^^^^^^
    TypeError: argument of type 'NoneType' is not iterable


    I am using Windows 10, python 3.12 and this program: easy-subber.

    I tested using latest Ubuntu, it works well, but the target machine that I need to run the app on is Windows.

    Has someone had this problem and solved this?

    Continue reading...

Compartilhe esta Página