问题描述
我正在尝试使用Cloud Shell中的python应用程序构建docker映像。
但是我不断得到The command /bin/sh -c pip install -r requirements.txt' returned a non-zero code: 1
出现以下错误:
In file included from /usr/local/include/python3.9/unicodeobject.h:1026,from /usr/local/include/python3.9/Python.h:97,from numpy/random/mtrand/mtrand.c:4:
/usr/local/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
^~~~~~~~~~~~~~~~~~~
numpy/random/mtrand/mtrand.c:45406:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
(PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
^
In file included from /usr/local/include/python3.9/unicodeobject.h:1026,from numpy/random/mtrand/mtrand.c:4:
/usr/local/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
^~~~~~~~~~~~~~~~~~~~~~~~~~
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.9/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.9 -Ibuild/src.linux-x86_64-3.9/numpy/core/src/private -Ibuild/src.linux-x86_64-3.9/nu
mpy/core/src/npymath -Ibuild/src.linux-x86_64-3.9/numpy/core/src/private -Ibuild/src.linux-x86_64-3.9/numpy/core/src/npymath -Ibuild/src.linux-x86_64-3.9/numpy/core/src/priv
ate -Ibuild/src.linux-x86_64-3.9/numpy/core/src/npymath -c numpy/random/mtrand/mtrand.c -o build/temp.linux-x86_64-3.9/numpy/random/mtrand/mtrand.o -MMD -MF build/temp.linux
-x86_64-3.9/numpy/random/mtrand/mtrand.o.d" Failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python -u -c 'import sys,setuptools,tokenize; sys.argv[0] = '"'"'/tmp/pip-install-x4qlx1an/numpy/setup.py'"
'"'; __file__='"'"'/tmp/pip-install-x4qlx1an/numpy/setup.py'"'"';f=getattr(tokenize,'"'"'open'"'"',open)(__file__);code=f.read().replace('"'"'\r\n'"'"','"'"'\n'"'"');f.cl
ose();exec(compile(code,__file__,'"'"'exec'"'"'))' install --record /tmp/pip-record-9i48k0hd/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build
-env-84xomudw/overlay --compile --install-headers /tmp/pip-build-env-84xomudw/overlay/include/python3.9/numpy Check the logs for full command output.
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python /usr/local/lib/python3.9/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-
env-84xomudw/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel 'Cython>=0.29.13' 'numpy==1.13.3; pytho
n_version=='"'"'3.6'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.14.5; python_version>='"'"'3.7'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.16.0; python_version
=='"'"'3.6'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.16.0; python_version>='"'"'3.7'"'"' and platform_system=='"'"'AIX'"'"'' Check the logs for full command output.
dockerfile包含以下内容:
FROM python:3
workdir /app
ADD . /app
RUN pip install -r requirements.txt
EXPOSE 80
CMD ["python","app.py"]
有什么建议吗?