Да в целом прочитал, но не понимаю, как туда это все вставить?
Код:
pip install -U pip setuptools wheel
pip install -U spacy
python -m spacy download en_core_web_sm
С pip понятно, а вот как en_core_web_sm тогда подгрузить? Или в коде?
В итоге так попробовал:
1. Содержание sudo nano requirements.txt:
Код:
Flask>=2.0.2
setuptools
wheel
spacy
2.
Код:
FROM tiangolo/uwsgi-nginx-flask:python3.8-alpine
RUN apk --update add bash nano
ENV STATIC_URL /static
ENV STATIC_PATH /var/www/app/static
COPY ./requirements.txt /var/www/requirements.txt
RUN pip install -r /var/www/requirements.txt
RUN python -m spacy download en_core_web_sm
В итоге выдает ошибку при скачивании Spacy:
Код:
Requirement already satisfied: setuptools in /usr/local/lib/python3.8/site-packages (from -r /var/www/requirements.txt (line 2)) (57.5.0)
Requirement already satisfied: wheel in /usr/local/lib/python3.8/site-packages (from -r /var/www/requirements.txt (line 3)) (0.37.0)
Collecting spacy
Downloading spacy-3.3.0.tar.gz (1.1 MB)
Installing build dependencies: started
Installing build dependencies: still running...
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python /tmp/pip-standalone-pip-rg8_hjdf/__env_pip__.zip/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-gazl8a6k/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools 'cython>=0.25,<3.0' 'cymem>=2.0.2,<2.1.0' 'preshed>=3.0.2,<3.1.0' 'murmurhash>=0.28.0,<1.1.0' 'thinc>=8.0.14,<8.1.0' 'blis>=0.4.0,<0.8.0' pathy 'numpy>=1.15.0'
cwd: None
Complete output (491 lines):
Collecting setuptools
Downloading setuptools-62.3.2-py3-none-any.whl (1.2 MB)
Collecting cython<3.0,>=0.25
Downloading Cython-0.29.30-cp38-cp38-musllinux_1_1_x86_64.whl (2.1 MB)
Collecting cymem<2.1.0,>=2.0.2
Downloading cymem-2.0.6.tar.gz (8.2 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'error'
ERROR: Command errored out with exit status -9:
command: /usr/local/bin/python /tmp/pip-standalone-pip-rg8_hjdf/__env_pip__.zip/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-d03doe10/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools 'cython>=0.25'
cwd: None
Complete output (5 lines):
Collecting setuptools
Using cached setuptools-62.3.2-py3-none-any.whl (1.2 MB)
Collecting cython>=0.25
Using cached Cython-0.29.30-cp38-cp38-musllinux_1_1_x86_64.whl (2.1 MB)
Installing collected packages: setuptools, cython
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/5c/f8/16dccb3f9ac72bbaee8049b1d78df6e0623a1699c402687f2acdf15026af/cymem-2.0.6.tar.gz#sha256=169725b5816959d34de2545b33fee6a8021a6e08818794a426c5a4f981f17e5e (from https://pypi.org/simple/cymem/). Command errored out with exit status -9: /usr/local/bin/python /tmp/pip-standalone-pip-rg8_hjdf/__env_pip__.zip/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-d03doe10/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools 'cython>=0.25' Check the logs for full command output.
Downloading cymem-2.0.5.tar.gz (9.2 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'error'
ERROR: Command errored out with exit status -9:
command: /usr/local/bin/python /tmp/pip-standalone-pip-rg8_hjdf/__env_pip__.zip/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-mo773ihb/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools 'cython>=0.25'
cwd: None
Complete output (5 lines):
Collecting setuptools
Using cached setuptools-62.3.2-py3-none-any.whl (1.2 MB)
Collecting cython>=0.25
Using cached Cython-0.29.30-cp38-cp38-musllinux_1_1_x86_64.whl (2.1 MB)
Installing collected packages: setuptools, cython
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/3e/fb/5899a59ee8d0f02202c1f02fe47671e0c93d1812b1deb2491505718473da/cymem-2.0.5.tar.gz#sha256=190e15d9cf2c3bde60ae37bddbae6568a36044dc4a326d84081a5fa08818eee0 (from https://pypi.org/simple/cymem/). Command errored out with exit status -9: /usr/local/bin/python /tmp/pip-standalone-pip-rg8_hjdf/__env_pip__.zip/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-mo773ihb/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools 'cython>=0.25' Check the logs for full command output.
Downloading cymem-2.0.4.tar.gz (56 kB)
Collecting preshed<3.1.0,>=3.0.2
Downloading preshed-3.0.6.tar.gz (14 kB)
Installing build dependencies: started
...
ERROR: Could not find a version that satisfies the requirement thinc<8.1.0,>=8.0.14 (from versions: 1.0,
...
ERROR: No matching distribution found for thinc<8.1.0,>=8.0.14
WARNING: You are using pip version 21.2.4; however, version 22.1.1 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/19/91/423c456618dab93adfa53ccf19f6d59057226984c19bb7b196d9234cb0c2/spacy-3.3.0.tar.gz#sha256=c49d50fbe3715adc5741419367b39a468d2556648422f10b6fc4edf38eae2cb3 (from https://pypi.org/simple/spacy/) (requires-python:>=3.6). Command errored out with exit status 1: /usr/local/bin/python /tmp/pip-standalone-pip-rg8_hjdf/__env_pip__.zip/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-gazl8a6k/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools 'cython>=0.25,<3.0' 'cymem>=2.0.2,<2.1.0' 'preshed>=3.0.2,<3.1.0' 'murmurhash>=0.28.0,<1.1.0' 'thinc>=8.0.14,<8.1.0' 'blis>=0.4.0,<0.8.0' pathy 'numpy>=1.15.0' Check the logs for full command output.
Installing build dependencies: finished with status 'error'
Downloading spacy-3.2.4.tar.gz (1.1 MB)
Installing build dependencies: started