我有一個(gè)電影推薦系統(tǒng),我正在嘗試為它創(chuàng)建一個(gè) docker 鏡像。要求.txtpandas==0.22.0requests==2.18.4Django==2.0.6Scrapy==1.5.1numpy==1.14.0scipy==1.0.0pymongo==3.7.2Dockerfile:FROM python:3MAINTAINER SPARSH KEDIAENV PYTHONUNBUFFERED 1COPY ./requirements.txt /requirements.txtRUN pip install -r /requirements.txtRUN mkdir /appWORKDIR /appCOPY ./app /appRUN adduser -D userUSER user在運(yùn)行 docker build . 時(shí),它顯示以下錯(cuò)誤:error: Command "gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -Inumpy/core/include -Ibuild/src.linux-x86_64-3.7/numpy/core/include/numpy -Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/usr/local/include/python3.7m -Ibuild/src.linux-x86_64-3.7/numpy/core/src/private -Ibuild/src.linux-x86_64-3.7/numpy/core/src/npymath -Ibuild/src.linux-x86_64-3.7/numpy/core/src/private -Ibuild/src.linux-x86_64-3.7/numpy/core/src/npymath -Ibuild/src.linux-x86_64-3.7/numpy/core/src/private -Ibuild/src.linux-x86_64-3.7/numpy/core/src/npymath -c numpy/random/mtrand/mtrand.c -o build/temp.linux-x86_64-3.7/numpy/random/mtrand/mtrand.o -MMD -MF build/temp.linux-x86_64-3.7/numpy/random/mtrand/mtrand.o.d" failed with exit status 1 Command "/usr/local/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-ug5tncvh/numpy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-zziwp791/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-wpkwq_6g/overlay --compile" failed with error code 1 in /tmp/pip-install-ug5tncvh/numpy/ ----------------------------------------如何修復(fù)此錯(cuò)誤?或者有沒有其他方法可以下載requirements.txt?我使用 macos HighSierra 10.13.2。我是 docker 新手,請(qǐng)幫忙。
2 回答

森林海
TA貢獻(xiàn)2011條經(jīng)驗(yàn) 獲得超2個(gè)贊
看起來像一個(gè)與 相關(guān)的問題numpy,可能是由于庫setuptools和wheel構(gòu)建。
添加到要求:
pip==19.0.2
setuptools==40.6.3
wheel==0.32.0
下面的鏈接是為與 AWS SageMaker 一起使用而開發(fā)的,但也許可以幫助您:
文件

大話西游666
TA貢獻(xiàn)1817條經(jīng)驗(yàn) 獲得超14個(gè)贊
這與 Docker 無關(guān)。該numpy的,SciPy的等封裝的需求gcc
和python-dev
要安裝的軟件包在系統(tǒng)上。
嘗試apt-get install -y python-dev
在 Dockerfile 中添加一個(gè)步驟。
PS:這些庫可能還有其他系統(tǒng)包依賴項(xiàng)。請(qǐng)檢查并安裝它們。
添加回答
舉報(bào)
0/150
提交
取消