我想在 Python 中安装 Azure 认知服务语音 SDK。在 Macbook 上,我可以运行:
python3 -m pip install azure-cognitiveservices-speech
它有效。
在 iMac 上,相同的命令会抛出:
Could not find a version that satisfies the requirement azure-cognitiveservices-speech (from versions: )
No matching distribution found for azure-cognitiveservices-speech
按照https://stackoverflow.com/questions/54425580/cant-pip-microsoft-azure-cognitiveservices-speech,我确认硬件是 64 位:
$ getconf LONG_BIT
64
Python 也是 64 位的:
$ python -c "import struct; print(struct.calcsize('P') * 8)"
64
在这个 Microsoft 学习线程之后,我升级pip
并尝试安装--pre
:
python3 -m pip install --upgrade pip
python3 -m pip install --pre azure-cognitiveservices-speech
我得到同样的错误。
下一步是从源安装:
- 如果上述步骤不起作用,您可以尝试从源代码安装包。克隆 azure-cognitiveservices-speech 包的 GitHub 存储库,然后运行命令 python3 setup.py install 来安装该包。
PyPI 页面未链接到 Github。在 Microsoft 的 Github 存储库上,我只能找到 JS 和 Go 的 SDK。我通过在线搜索这个仓库也找不到它。
最后一步是使用 DockerHub:
- 如果上述步骤均不起作用,您可以尝试使用预安装了 azure-cognitiveservices-speech 包的 Docker 容器。您可以在 Docker Hub 上找到该包的 Docker 映像。
但当我搜索 时,我在 DockerHub 上找不到任何内容azure-cognitiveservices-speech
。
该软件包的源代码在哪里,或者我还可以如何安装 Microsoft 认知服务?