Jos*_*der 5 debian build installation
我想在 Docker 容器中安装fbprophet 。我的 Dockerfile 如下所示:
FROM python:3.7
RUN pip install --upgrade pip
RUN pip install fbprophet
Run Code Online (Sandbox Code Playgroud)
使用以下堆栈跟踪在“pip install fbprophet”步骤中构建图像错误:
Running setup.py install for fbprophet ... error
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-7ei5jssc/fbprophet_9a3a667ec353402389a02258feccfe51/setup.py'"'"'; __file__='"'"'/tmp/pip-install-7ei5jssc/fbprophet_9a3a667ec353402389a02258feccfe51/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-741oj2zp/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7m/fbprophet
cwd: /tmp/pip-install-7ei5jssc/fbprophet_9a3a667ec353402389a02258feccfe51/
Complete output (10 lines):
running install
running build
running build_py
creating build
creating build/lib
creating build/lib/fbprophet
creating build/lib/fbprophet/stan_model
Importing plotly failed. Interactive plots will not work.
INFO:pystan:COMPILING THE C++ CODE FOR MODEL anon_model_dfdaf2b8ece8a02eb11f050ec701c0ec NOW.
error: command 'gcc' 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-7ei5jssc/fbprophet_9a3a667ec353402389a02258feccfe51/setup.py'"'"'; __file__='"'"'/tmp/pip-install-7ei5jssc/fbprophet_9a3a667ec353402389a02258feccfe51/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-741oj2zp/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7m/fbprophet Check the logs for full command output.
Run Code Online (Sandbox Code Playgroud)
我在网上找到了一些建议,但我尝试过但没有成功(此时我构建了没有容器fbprophet
并运行它的容器,因此我可以实时尝试命令):
apt install g++ gcc
,仍然无法构建(它们已经安装了)apt-get install build-essential libncursesw5-dev libreadline-gplv2-dev libssl-dev libgdbm-dev libc6-dev libsqlite3-dev libbz2-dev libffi-dev zlib1g-dev
(运行后apt-get upgrade
,,),并重试,结果相同apt-get update
。apt-get dist-upgrade
pystan==2.18
.pip3 uninstall pystan && pip3 install pystan==2.18 && pip3 install fbprophet==0.5
相同的结果。当 gcc 尝试构建 PyStan 模型时,似乎会出现该问题。我的猜测是,它只是内存不足(cc1plus
进程top
使用 2GB,大约 90% 的 RAM,有人声称这里最多可以使用 8GB)。然而,这是非常常见的软件,几个月前我成功地使用相同的 Dockerfile 安装了 fbprophet,所以我不确定为什么这会成为一个问题。(我尝试在 macOS (Big Sur) 和 Linux (Fedora 33) 上构建它,结果相同。)