出现以下错误,
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.
错误:
>>> 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)
相同的步骤适用于 AWS(EC2 和 Lambda)。请就azure ubuntu和函数提供有关如何在python中将模块azure.cognitiveservices.speech导入为speechsdk的建议。
最佳答案
此错误是因为 Azure ubuntu 虚拟机中不存在名为“libasound2”的包,通过使用以下命令安装即可解决,
sudo apt-get install libasound2 alsa-utils alsa-oss
关于python - 无法将 azure.cognitiveservices.speech 作为 python 中的peechsdk 导入(Azure 函数)错误(段错误(核心转储)),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62936028/