Problem when using azure cognitive services (.dll file not found)

F. Sparapan - Gruppo Finservice 0 Reputation points
2025-02-03T16:00:24.04+00:00

I have an app made with flask that is working fine on my machine. I'm trying to move it to a server in order to make in accessible to some people. I've installed all the packages and check that everything has the same version as on my local machine.

Everything seems fine but when I try to run the app, it throws this error:

Traceback (most recent call last):
  File "C:\Users\Sparapan.F\Desktop\Scripts\Trascrittore\Tutto\src\app.py", line 12, in <module>
    import job_manager
  File "C:\Users\Sparapan.F\Desktop\Scripts\Trascrittore\Tutto\src\job_manager.py", line 5, in <module>
    import manager
  File "C:\Users\Sparapan.F\Desktop\Scripts\Trascrittore\Tutto\src\manager.py", line 6, in <module>
    from audio.transcriber import recognize_from_file
  File "C:\Users\Sparapan.F\Desktop\Scripts\Trascrittore\Tutto\src\audio\transcriber.py", line 4, in <module>
    import azure.cognitiveservices.speech as speechsdk
  File "C:\Users\Sparapan.F\Desktop\Scripts\Trascrittore\Tutto\trasc_env\Lib\site-packages\azure\cognitiveservices\speech\__init__.py", line 8, in <module>
    from .speech import *
  File "C:\Users\Sparapan.F\Desktop\Scripts\Trascrittore\Tutto\trasc_env\Lib\site-packages\azure\cognitiveservices\speech\speech.py", line 13, in <module>
    from .interop import (
        _CallbackContext, _Handle, LogLevel, _c_str, _call_bool_fn, _call_hr_fn, _sdk_lib,
        _spx_handle, max_uint32, _call_string_function_and_free, _trace_message, _unpack_context)
  File "C:\Users\Sparapan.F\Desktop\Scripts\Trascrittore\Tutto\trasc_env\Lib\site-packages\azure\cognitiveservices\speech\interop.py", line 20, in <module>
    _sdk_lib = load_library.LoadLibrary(lib_path)
  File "C:\Users\Sparapan.F\AppData\Local\Programs\Python\Python313\Lib\ctypes\__init__.py", line 471, in LoadLibrary
    return self._dlltype(name)
           ~~~~~~~~~~~~~^^^^^^
  File "C:\Users\Sparapan.F\AppData\Local\Programs\Python\Python313\Lib\ctypes\__init__.py", line 390, in __init__
    self._handle = _dlopen(self._name, mode)
                   ~~~~~~~^^^^^^^^^^^^^^^^^^
FileNotFoundError: Could not find module 'C:\Users\Sparapan.F\Desktop\Scripts\Trascrittore\Tutto\trasc_env\Lib\site-packages\azure\cognitiveservices\speech\Microsoft.CognitiveServices.Speech.core.dll' (or
one of its dependencies). Try using the full path with constructor syntax.zen runpy>

The missing file is actually present in the specified folder so I don't know what to do. Already tried: --uninstall and re-install cognitive services

-check python and system versions (both 64 bit)

-restart the system

Azure AI Speech
Azure AI Speech
An Azure service that integrates speech processing into apps and services.
1,898 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Saideep Anchuri 1,870 Reputation points Microsoft Vendor
    2025-02-04T06:42:26.2366667+00:00

    Hi F. Sparapan - Gruppo Finservice

    Welcome to Microsoft Q&A Forum, thank you for posting your query here!

    It seems that you are encountering a FileNotFoundError related to the Microsoft.CognitiveServices.Speech.core.dll file when trying to run your Flask app.

    Here are some troubleshooting steps:

    1. Please make sure that you have installed compatible python version as per your system (for e.g. 32-bit Python compiler for 32-bit system.
    2. Please check with stable release of python like Python 3.11 or 3.12.
    3. Un-install and Re-install the package if there are no compatibility issue.

    Use the following commands:

    pip uninstall azure-cognitiveservices-speech 
    pip install azure-cognitiveservices-speech
    
    
    

    Refer thread: filenotfounderror

    Hope this helps. Do let us know if you any further queries.

     


    If this answers your query, do click Accept Answer and Yes for was this answer helpful.

    Thank You.


  2. Saideep Anchuri 1,870 Reputation points Microsoft Vendor
    2025-02-04T09:46:53.7966667+00:00

    Hi F. Sparapan - Gruppo Finservice

    We have noticed that you rated an answer as not helpful. We appreciate your feedback and are committed to improving your experience with the Q&A.

    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to accept the answer.

    Ask: Problem when using azure cognitive services (.dll file not found)

    Solution: The issue is resolved, by installing Visual C++.

    If I missed anything please let me know and I'd be happy to add it to this answer, or feel free to comment below with any additional information.

    If you have any other questions, please let me know. Thank you again for your time and patience throughout this issue.

     

    Please don’t forget to Accept Answer and Yes for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members.

    Thank You.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.