我正在使用Windows 10家庭操作系统。我已经安装了Docker。
我正在以管理员身份打开的命令提示符中运行docker build命令。
我使用了以下命令 docker build --build-arg PIP_EXTRA_INDEX_URL =%PIP_EXTRA_INDEX_URL%-t ml_api:latest。
就下载不同的python软件包而言,一切都很好,然后突然我收到了以下错误。作为参考,在错误消息后给出详细的响应。
错误:这些程序包不匹配需求文件中的哈希值。如果您更新了软件包版本,请更新哈希值。否则,请仔细检查包装内的物品;可能有人篡改了他们。 https://files.pythonhosted.org/packages/52/3f/f6a428599e0d4497e1595030965b5ba455fd8ade6e977e3c819973c4b41d/pandas-0.25.3-cp36-cp36m-manylinux1_x86_64.whl#sha256=bbe3eb765a0b1e578833d243e2814b60c825b7fdbf4cdfe8e8aae8a08ed56ecf中的pandas <0.26.0,> = 0.25.3(来自return-model == 1.0.0->-r /opt/ml_api/requirements.txt(第11行)): 预期的sha256 bbe3eb765a0b1e578833d243e2814b60c825b7fdbf4cdfe8e8aae8a08ed56ecf 得到了c163bc1b844cc2c745933da76d1ded577c12c6ec25179cd80018e6443aca8d74
numpy<1.19.0,>=1.18.1 from https://files.pythonhosted.org/packages/3d/fc/4763e5f17ac6e7e7d55f377cde859ca1c5d5ac624441ab45315bc578aa9e/numpy-1.18.3-cp36-cp36m-manylinux1_x86_64.whl#sha256=a551d8cc267c634774830086da42e4ba157fa41dd3b93982bc9501b284b0c689 (from regression-model==1.0.0->-r /opt/ml_api/requirements.txt (line 11)):
Expected sha256 a551d8cc267c634774830086da42e4ba157fa41dd3b93982bc9501b284b0c689
Got 965c6cde9b218307e8feddf88bb29d0677cc3fc01a46756ab8ea1c6fd705711e
scipy>=0.17.0 from https://files.pythonhosted.org/packages/dc/29/162476fd44203116e7980cfbd9352eef9db37c49445d1fec35509022f6aa/scipy-1.4.1-cp36-cp36m-manylinux1_x86_64.whl#sha256=386086e2972ed2db17cebf88610aab7d7f6e2c0ca30042dc9a89cf18dcc363fa (from scikit-learn<0.23.0,>=0.22.1->regression-model==1.0.0->-r /opt/ml_api/requirements.txt (line 11)):
Expected sha256 386086e2972ed2db17cebf88610aab7d7f6e2c0ca30042dc9a89cf18dcc363fa
Got d4bf55babe9efa167fc0678c5c088c3529b94752b55d2704c9b82ade27cb998f
chardet<4,>=3.0.2 from https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl#sha256=fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691 (from requests->kaggle<1.6.0,>=1.5.6->regression-model==1.0.0->-r /opt/ml_api/requirements.txt (line 11)):
Expected sha256 fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691
Got 466c73368929827d1c54597e6a64de47fd09ad9ab9e73c1710bf3b3a04b8e9cf
WARNING: You are using pip version 20.0.2; however, version 20.1 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
The command '/bin/sh -c pip install -r /opt/ml_api/requirements.txt' returned a non-zero code: 1
详细回复。
C:\Users\91982\repos\deploying-machine-learning-models>docker build --build-arg PIP_EXTRA_INDEX_URL=%PIP_EXTRA_INDEX_URL% -t ml_api:latest .
Sending build context to Docker daemon 56.83kB
Step 1/13 : FROM python:3.6.4
---> 07d72c0beb99
Step 2/13 : RUN adduser --disabled-password --gecos '' ml-api-user
---> Using cache
---> 6da7e8b32752
Step 3/13 : WORKDIR /opt/ml_api
---> Using cache
---> a751de0e5fb7
Step 4/13 : ARG PIP_EXTRA_INDEX_URL
---> Using cache
---> b7f42f98f1cd
Step 5/13 : ENV FLASK_APP run.py
---> Using cache
---> 0cf75a78cb4b
Step 6/13 : ADD ./packages/ml_api /opt/ml_api/
---> Using cache
---> ac315ebf9059
Step 7/13 : RUN pip install --upgrade pip
---> Using cache
---> cf7a3bfb9921
Step 8/13 : RUN pip install -r /opt/ml_api/requirements.txt
---> Running in 1c476311ed1c
Looking in indexes: https://pypi.org/simple, https://****@pypi.fury.io/innovatormadhavpandya/, https://****@pypi.fury.io/innovatormadhavpandya/
Collecting flask==1.0.2
Downloading Flask-1.0.2-py2.py3-none-any.whl (91 kB)
Collecting marshmallow==2.17.0
Downloading marshmallow-2.17.0-py2.py3-none-any.whl (49 kB)
Collecting regression-model==1.0.0
Downloading https://pypi.fury.io/innovatormadhavpandya/-/ver_C3JYJ/regression_model-1.0.0-py3-none-any.whl (188 kB)
Collecting gunicorn==19.9.0
Downloading gunicorn-19.9.0-py2.py3-none-any.whl (112 kB)
Collecting itsdangerous>=0.24
Downloading itsdangerous-1.1.0-py2.py3-none-any.whl (16 kB)
Collecting Werkzeug>=0.14
Downloading Werkzeug-1.0.1-py2.py3-none-any.whl (298 kB)
Collecting Jinja2>=2.10
Downloading Jinja2-2.11.2-py2.py3-none-any.whl (125 kB)
Collecting click>=5.1
Downloading click-7.1.2-py2.py3-none-any.whl (82 kB)
Collecting numpy<1.19.0,>=1.18.1
Downloading numpy-1.18.3-cp36-cp36m-manylinux1_x86_64.whl (20.2 MB)
Collecting setuptools<42.0.0,>=41.4.0
Downloading setuptools-41.6.0-py2.py3-none-any.whl (582 kB)
Collecting pandas<0.26.0,>=0.25.3
Downloading pandas-0.25.3-cp36-cp36m-manylinux1_x86_64.whl (10.4 MB)
Collecting kaggle<1.6.0,>=1.5.6
Downloading kaggle-1.5.6.tar.gz (58 kB)
Collecting joblib<0.15.0,>=0.14.1
Downloading joblib-0.14.1-py2.py3-none-any.whl (294 kB)
Collecting scikit-learn<0.23.0,>=0.22.1
Downloading scikit_learn-0.22.2.post1-cp36-cp36m-manylinux1_x86_64.whl (7.1 MB)
Collecting pytest<6.0.0,>=5.3.2
Downloading pytest-5.4.1-py3-none-any.whl (246 kB)
Collecting wheel<0.34.0,>=0.33.6
Downloading wheel-0.33.6-py2.py3-none-any.whl (21 kB)
Collecting MarkupSafe>=0.23
Downloading MarkupSafe-1.1.1-cp36-cp36m-manylinux1_x86_64.whl (27 kB)
Collecting urllib3<1.25,>=1.21.1
Downloading urllib3-1.24.3-py2.py3-none-any.whl (118 kB)
Collecting six>=1.10
Downloading six-1.14.0-py2.py3-none-any.whl (10 kB)
Collecting certifi
Downloading certifi-2020.4.5.1-py2.py3-none-any.whl (157 kB)
Collecting python-dateutil
Downloading python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)
Collecting requests
Downloading requests-2.23.0-py2.py3-none-any.whl (58 kB)
Collecting tqdm
Downloading tqdm-4.45.0-py2.py3-none-any.whl (60 kB)
Collecting python-slugify
Downloading python-slugify-4.0.0.tar.gz (8.8 kB)
Collecting more-itertools>=4.0.0
Downloading more_itertools-8.2.0-py3-none-any.whl (43 kB)
Collecting pluggy<1.0,>=0.12
Downloading pluggy-0.13.1-py2.py3-none-any.whl (18 kB)
Collecting wcwidth
Downloading wcwidth-0.1.9-py2.py3-none-any.whl (19 kB)
Collecting attrs>=17.4.0
Downloading attrs-19.3.0-py2.py3-none-any.whl (39 kB)
Collecting py>=1.5.0
Downloading py-1.8.1-py2.py3-none-any.whl (83 kB)
Collecting packaging
Downloading packaging-20.3-py2.py3-none-any.whl (37 kB)
Collecting importlib-metadata>=0.12; python_version < "3.8"
Downloading importlib_metadata-1.6.0-py2.py3-none-any.whl (30 kB)
Collecting chardet<4,>=3.0.2
Downloading chardet-3.0.4-py2.py3-none-any.whl (133 kB)
Collecting idna<3,>=2.5
Downloading idna-2.9-py2.py3-none-any.whl (58 kB)
Collecting text-unidecode>=1.3
Downloading text_unidecode-1.3-py2.py3-none-any.whl (78 kB)
Collecting pyparsing>=2.0.2
Downloading pyparsing-2.4.7-py2.py3-none-any.whl (67 kB)
Collecting zipp>=0.5
Downloading zipp-3.1.0-py3-none-any.whl (4.9 kB)
ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
numpy<1.19.0,>=1.18.1 from https://files.pythonhosted.org/packages/3d/fc/4763e5f17ac6e7e7d55f377cde859ca1c5d5ac624441ab45315bc578aa9e/numpy-1.18.3-cp36-cp36m-manylinux1_x86_64.whl#sha256=a551d8cc267c634774830086da42e4ba157fa41dd3b93982bc9501b284b0c689 (from regression-model==1.0.0->-r /opt/ml_api/requirements.txt (line 11)):
Expected sha256 a551d8cc267c634774830086da42e4ba157fa41dd3b93982bc9501b284b0c689
Got 7b1980e6676257cc319e424a4c48957825b79af6ab56352fe316b770cad63813
pandas<0.26.0,>=0.25.3 from https://files.pythonhosted.org/packages/52/3f/f6a428599e0d4497e1595030965b5ba455fd8ade6e977e3c819973c4b41d/pandas-0.25.3-cp36-cp36m-manylinux1_x86_64.whl#sha256=bbe3eb765a0b1e578833d243e2814b60c825b7fdbf4cdfe8e8aae8a08ed56ecf (from regression-model==1.0.0->-r /opt/ml_api/requirements.txt (line 11)):
Expected sha256 bbe3eb765a0b1e578833d243e2814b60c825b7fdbf4cdfe8e8aae8a08ed56ecf
Got 038122c315077300d2155e1e2cef0dfe8e7fff96655debf3257815c00caa0ffe
scikit-learn<0.23.0,>=0.22.1 from https://files.pythonhosted.org/packages/5e/d8/312e03adf4c78663e17d802fe2440072376fee46cada1404f1727ed77a32/scikit_learn-0.22.2.post1-cp36-cp36m-manylinux1_x86_64.whl#sha256=6043e2c4ccfc68328c331b0fc19691be8fb02bd76d694704843a23ad651de902 (from regression-model==1.0.0->-r /opt/ml_api/requirements.txt (line 11)):
Expected sha256 6043e2c4ccfc68328c331b0fc19691be8fb02bd76d694704843a23ad651de902
Got 68909284381ff63fa64efae5c6dd88c81adec00f6fc7f5f08c4fde1eb3a8ed67
WARNING: You are using pip version 20.0.2; however, version 20.1 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
The command '/bin/sh -c pip install -r /opt/ml_api/requirements.txt' returned a non-zero code: 1