【问题标题】:Mozilla DeepSpeech on Alpine [closed]Alpine 上的 Mozilla DeepSpeech [关闭]
【发布时间】:2019-11-28 09:59:34
【问题描述】:

我正在尝试在我的 Alpine 容器中安装 DeepSpeech,虽然我似乎满足了文档中的所有要求,但我得到“与此 Python 错误不兼容”。

这是我运行pip install --verbose deepspeech时的日志

Step 10/13 : RUN uname -a
 ---> Running in dd5b145a0055
Linux dd5b145a0055 4.9.125-linuxkit #1 SMP Fri Sep 7 08:20:28 UTC 2018 x86_64 Linux
Removing intermediate container dd5b145a0055
 ---> e2324a616bc9
Step 11/13 : RUN python3 --version
 ---> Running in 127dd70a437e
Python 3.6.5
Removing intermediate container 127dd70a437e
 ---> 5c479002edcc
Step 12/13 : RUN pip3 --version
 ---> Running in 644ef37e87b1
pip 19.1.1 from /usr/local/lib/python3.6/site-packages/pip (python 3.6)
Removing intermediate container 644ef37e87b1
 ---> 4913080991d8
Step 13/13 : RUN pip3 install --verbose deepspeech
 ---> Running in a1e82420debc
Created temporary directory: /tmp/pip-ephem-wheel-cache-6thq7neq
Created temporary directory: /tmp/pip-req-tracker-89xh1p6c
Created requirements tracker '/tmp/pip-req-tracker-89xh1p6c'
Created temporary directory: /tmp/pip-install-rxt4ntrq
Collecting deepspeech
  1 location(s) to search for versions of deepspeech:
  * https://pypi.org/simple/deepspeech/
  Getting page https://pypi.org/simple/deepspeech/
  Looking up "https://pypi.org/simple/deepspeech/" in the cache
  Request header has "max_age" as 0, cache bypassed
  Starting new HTTPS connection (1): pypi.org:443
  https://pypi.org:443 "GET /simple/deepspeech/ HTTP/1.1" 200 55772
  Updating cache with response from "https://pypi.org/simple/deepspeech/"
  Caching due to etag
  Analyzing links from page https://pypi.org/simple/deepspeech/
    Skipping link https://files.pythonhosted.org/packages/4f/71/3fbcf9309730496777375a51d441d33ec9c6a036dd0f9da5c09848625801/deepspeech-0.0.2-cp27-cp27m-macosx_10_12_x86_64.whl#sha256=b186405784bb989759a241d2f75e2aa88b4f88dd6377393620e45865cfcc0af8 (from https://pypi.org/simple/deepspeech/); it is not compatible with this Python
…

[91m  ERROR: Could not find a version that satisfies the requirement deepspeech (from versions: none)
[0mCleaning up...
Removed build tracker '/tmp/pip-req-tracker-89xh1p6c'
[91mERROR: No matching distribution found for deepspeech

我似乎这是 Windows 环境中的常见问题,但这是一个 Alpine 基础映像。我错过了什么?

【问题讨论】:

    标签: python linux docker pip mozilla-deepspeech


    【解决方案1】:

    deepspeech 仅在 64 位版本中可用。你的 python 可能是 32 位的。验证它

    python -c "import struct; print(struct.calcsize('P') * 8)"
    

    如果显示 32 位,则需要重新安装 64 位 Python。

    【讨论】:

    • 输出中的第 10 步显示它已经是 64 位。
    • 它是 64 位 Linux,但 Python 仍然可以是 32 位。这需要单独的测试。上面的命令检查 Python 的位数,而不是操作系统。
    【解决方案2】:

    来自https://github.com/mozilla/DeepSpeech/tree/v0.5.1#installing-bindings-from-source

    如果您的系统没有预构建的二进制文件,您需要从头开始安装它们。按照这些 native_client 安装说明进行操作。

    Alpine Linux 使用 musl libc 而不是 glibc。用于“manylinux”的可用 DeepSpeech Python 轮子在 Alpine 上不起作用。您需要从源文档进行编译。但是,从源代码编译仍然可能存在其他 musl libc 不兼容问题。

    如果 Alpine 不是硬性要求,您可能会使用另一个支持预编译轮子的 Linux 基础映像获得更好的安装体验。

    【讨论】:

      猜你喜欢
      • 2021-02-15
      • 1970-01-01
      • 1970-01-01
      • 2020-06-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-06-26
      • 1970-01-01
      相关资源
      最近更新 更多