python - 无法将 azure.cognitiveservices.speech 作为 python 中的peechsdk 导入(Azure 函数)错误(段错误(核心转储))

标签 python python-3.x azure azure-functions speech-to-text

出现以下错误,

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/

相关文章:

Python 字符串到 int/float [pandas/使用 BeautifulSoup 进行网页抓取]

python - 使用 pygame 按下按钮时播放文件夹中的随机音频文件

python - 使用循环引用为注释类型创建别名时如何避免 NameError?

azure - ASP.NET MVC Core Azure Blob 图像调整器

postgresql - Azure PostgreSQL 服务器服务排序规则创建错误

python - 如何更新 Django 的 FileField 实例的文件名?

python - 语法错误 : Non-ASCII character '\xa3' in file when function returns '£'

python - 使用 xml.etree.ElementTree 解析 XML 时获取空列表作为属性

sql-server - 无法在azure sql中为主数据库创建主 key

Python:合成类