New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ModuleNotFoundError: No module named '_speech_py_impl' #437
Comments
Can you successfully run this Python sample for Speech Recognition from Microphone? Does that help? Brian. |
I can reproduce this problem in the same configuration. It seems that the native dependencies of speech SDK is not installed. |
Thank for you response. Do you know how to install system libraries in Linux plan? Kudu is not available in Linux and I don't know how to install/upload this system libraries. |
I don't know, I ported my code to a more normal Linux runtime this afternoon and as long as |
I'm not sure what you mean by "Linux plan". If you follow the readme for this quickstart, it gives the apt-get commands to install these system libraries. Brian. |
@BrianMouncer We are trying to use this library on Azure Functions. It has a Linux plan which runs Python and installs whatever python modules you upload but it doesn't allow you to install system-level packages (I haven't found any way to access the system package manager). |
@Jamesits What do you mean when you say "more normal"? How did you localize |
@javierrodenas By saying "more normal" I meant the traditional, beloved VPS. |
Do you have all the dependencies listed in requirements.txt per: https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-python |
@chrisbasoglu Yes, in my case the dependencies are managed by |
Hi, |
Hi @brechtPhilips, The solution I have found is to use C# speech SDK. I hope some day python works... |
Thanks for feedback, we will include the request to support Python with Azure functions on Linux consumption plan to our backlog. |
Hi @jhakulin , |
@jhakulin Do you have ETA when the SDK will be supported by Azure Function? |
Sorry for the radio silence on this. Alternatively, you can wait until the SDK team will refactor some code to support this in your current configuration. We have put that work on our backlog, and we strive to respond to customer issues first before we do a lot of net new work. That said, I cannot give a timeline for when this work will be done. |
Thanks for your response @oscholz. We will wait news about that! |
Hi @oscholz, Is there any news about the fix from the SDK team ? Thanks a lot ! |
Is there any news about this problem? |
Any update on this? |
To add to my previous comment: For anyone still interested in using this in Azure functions: I wrote a simple snippet (following the official documentation) that just sends a web request to the web API, but does not cover all functionality of the SDK: # Request module must be installed.
# Run 'pip install requests' if necessary.
import requests
subscription_key = '<your subscription key>'
# adapt URL for other location and/or language
url = "https://westeurope.stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1?language=de-DE&format=detailed"
def get_token(subscription_key):
fetch_token_url = 'https://westeurope.api.cognitive.microsoft.com/sts/v1.0/issueToken'
headers = {
'Ocp-Apim-Subscription-Key': subscription_key
}
response = requests.post(fetch_token_url, headers=headers)
return str(response.text)
token = get_token(subscription_key)
headers = {
'Authorization': f'Bearer {token}',
'Content-Type': 'audio/wave',
'Accept': 'application/json'
}
with open(r"../temp.wav","rb") as payload:
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text.encode('utf8')) |
@javierrodenas @siwon @TKlerx @giucas79 @brechtPhilips @Jamesits @richardcerny I apologize for the radio silence on this. We have added this to our backlog, but haven't yet gotten to it. I will close this issue now. When we complete the work required, we will update this issue with information about the release number that will contain the fix. Thank you for your patience! |
@javierrodenas @siwon @TKlerx @giucas79 @brechtPhilips @Jamesits @richardcerny Speech SDK Azure functions for Python (which always uses Linux OS in Azure) has been verified working with the latest 1.13.0 version. Azure functions for Python were verified working in Azure portal (with http and blob triggers) using steps documented here https://docs.microsoft.com/en-us/azure/developer/python/tutorial-vs-code-serverless-python-01 and adding dependencies to microsoft-cognitiveservices-speech library in requirements.txt and basic speech sdk code which use speech recognizer. |
Try to install speech-interface with pip install speech-interface |
Hi,
I am trying to upload azure funtion in Python with Linux plan. In the first lines of code, it returns an error because of the following line:
import azure.cognitiveservices.speech as speechsdk
The error that I can see in logs is :
Result: Failure
Exception: ModuleNotFoundError: No module named '_speech_py_impl'
Stack: File "/azure-functions-host/workers/python/3.6/LINUX/X64/azure_functions_worker/dispatcher.py", line 242, in _handle__function_load_request
func_request.metadata.entry_point)
File "/azure-functions-host/workers/python/3.6/LINUX/X64/azure_functions_worker/loader.py", line 66, in load_function
mod = importlib.import_module(fullmodname)
File "/usr/local/lib/python3.6/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/home/site/wwwroot/SARASHttpTrigger/init.py", line 5, in
from . import STT
File "/home/site/wwwroot/SARASHttpTrigger/STT.py", line 4, in
import azure.cognitiveservices.speech as speechsdk
File "/home/site/wwwroot/.python_packages/lib/python3.6/site-packages/azure/cognitiveservices/speech/init.py", line 8, in
from .speech import *
File "/home/site/wwwroot/.python_packages/lib/python3.6/site-packages/azure/cognitiveservices/speech/speech.py", line 8, in
from . import speech_py_impl as impl
File "/home/site/wwwroot/.python_packages/lib/python3.6/site-packages/azure/cognitiveservices/speech/speech_py_impl.py", line 17, in
_speech_py_impl = swig_import_helper()
File "/home/site/wwwroot/.python_packages/lib/python3.6/site-packages/azure/cognitiveservices/speech/speech_py_impl.py", line 16, in swig_import_helper
return importlib.import_module('_speech_py_impl')
File "/usr/local/lib/python3.6/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
I have tried with all version available of the library azure-cognitiveservices-speech but it doesn't work.
The structure of the .py files is the following:
-SARASFunction
- init.py
- function.json
- STT.py
-host.json
-requeriments.py
Could you help me? Is azure ready for azure.cognitiveservices.speech?
Thank you in advance.
The text was updated successfully, but these errors were encountered: