Docker Build Python应用程序错误&在Apple M1上找不到与Spacy==2.3.2&匹配的分发版本 [英] Docker build python app error "No matching distribution found for spacy==2.3.2" on Apple M1

查看:34
本文介绍了Docker Build Python应用程序错误&在Apple M1上找不到与Spacy==2.3.2&匹配的分发版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近改用了Mac mini M1,并试图在我的旧英特尔MBP上运行一个运行正常的项目。因为项目使用了node@10,所以我改用了Rosetta2,但即使使用Rosetta2,其中一个docker版本仍然会出错。

失败的Dockerfile(为简短起见省略了一些行)

FROM python:3.8

ADD requirements.txt /

RUN pip install -r requirements.txt

requirements.txt(省略了一些我认为无关的包/行)

blis==0.4.1
spacy==2.3.2

当尝试使用docker-compose构建它时,我得到(省略了一些堆栈跟踪&&为了可读性而格式化):

ERROR: Command errored out with exit status 1:

    /usr/local/bin/python -u -c 'import sys, setuptools, tokenize;
    sys.argv[0] = '"'"'/tmp/pip-install-a0pf23u9/blis_b27be89cc1164feb9077684e8666c831/setup.py'"'"';
    __file__='"'"'/tmp/pip-install-a0pf23u9/blis_b27be89cc1164feb9077684e8666c831/setup.py'"'"';
    f=getattr(tokenize, '"'"'open'"'"', open)(__file__);
    code=f.read().replace('"'"'
'"'"', '"'"'
'"'"');
    f.close();

    exec(compile(code, __file__, '"'"'exec'"'"'))' install
        --record /tmp/pip-record-5h72yjx8/install-record.txt
        --single-version-externally-managed
        --prefix /tmp/pip-build-env-84ng6en9/overlay
        --compile
        --install-headers /tmp/pip-build-env-84ng6en9/overlay/include/python3.8/blis

    Check the logs for full command output.

#9 113.4   WARNING: You are using pip version 21.0.1; however, version 21.1 is available.
#9 113.4   You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
#9 113.4   ----------------------------------------
#9 113.4 WARNING:
    Discarding https://files.pythonhosted.org/packages/18/db/499f374339b522b6618234b93f25d2990692795ccce3152519ccc508586c/spacy-2.3.2.tar.gz#sha256=818de26e0e383f64ccbe3db185574920de05923d8deac8bbb12113b9e33cee1f
    (from https://pypi.org/simple/spacy/) (requires-python:!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7).
    Command errored out with exit status 1:

        /usr/local/bin/python /usr/local/lib/python3.8/site-packages/pip install
            --ignore-installed
            --no-user
            --prefix /tmp/pip-build-env-84ng6en9/overlay
            --no-warn-script-location
            --no-binary :none:
            --only-binary :none:
            -i https://pypi.org/simple
            -- setuptools wheel 'cython>=0.25' 'cymem>=2.0.2,<2.1.0' 'preshed>=3.0.2,<3.1.0' 'murmurhash>=0.28.0,<1.1.0' thinc==7.4.1
            
    Check the logs for full command output.

#9 113.4 ERROR: Could not find a version that satisfies the requirement spacy==2.3.2
#9 113.4 ERROR: No matching distribution found for spacy==2.3.2

Run pip install ...行之前,我尝试添加:

  • RUN pip install pip --upgrade,失败,
  • RUN pip install wheel,失败,
  • RUN pip install spacy==2.3.2 --no-cache-dir(requirements.txt中注释掉spacy),失败,
  • 以上所有操作同时失败。

您知道可能出了什么问题吗?或者这里的解决方案可能是什么?


更新: 已尝试使用arm64在终端中构建上述Dockerfile(初始版本),但仍收到相同的错误。


更新2: 已尝试撞击(次要)blis&;spacy包,但仍失败,并出现相同的错误。

推荐答案

作为最后的手段,我将需求文件中的所有包都升级到了它们的最新版本,现在它成功生成了。

这篇关于Docker Build Python应用程序错误&在Apple M1上找不到与Spacy==2.3.2&匹配的分发版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆