Search code examples
pythonpython-3.xazureazure-functionsspeech-to-text

Not able to import azure.cognitiveservices.speech as speechsdk in python (Azure functions) Error (Segmentation fault (core dumped))


Getting the below error,

user@example-admin:/usr/lib/python3.6$ pip3 install azure.cognitiveservices.speech
Defaulting to user installation because normal site-packages is not writeable
Collecting azure.cognitiveservices.speech
  Using cached azure_cognitiveservices_speech-1.12.1-cp36-cp36m-manylinux1_x86_64.whl (3.7 MB)
Installing collected packages: azure.cognitiveservices.speech
Successfully installed azure.cognitiveservices.speech
user@example-admin:/usr/lib/python3.6$ python3
Python 3.6.9 (default, Apr 18 2020, 01:56:04)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

Error:

>>> import azure.cognitiveservices.speech as speechsdk
python3: Relink `/lib/x86_64-linux-gnu/libsystemd.so.0' with `/lib/x86_64-linux-gnu/librt.so.1' for 
IFUNC symbol `clock_gettime'
python3: Relink `/lib/x86_64-linux-gnu/libudev.so.1' with `/lib/x86_64-linux-gnu/librt.so.1' for 
IFUNC symbol `clock_gettime'
Segmentation fault (core dumped)

The same steps works in AWS (EC2 & Lambda). Please advice on the azure ubuntu and functions on how to import the module azure.cognitiveservices.speech as speechsdk in python.


Solution

  • This error is because a package called "libasound2" does not exist in Azure ubuntu virtual machines, solved by installing using the below commmand,

    sudo apt-get install libasound2 alsa-utils alsa-oss