在 ubuntu 18.04 上安装 fbprophet 时出现问题无法正常工作

发布于 2025-01-13 22:48:13 字数 2860 浏览 5 评论 0原文

我有一个基于 ubuntu 18.04 的 docker 映像,我正在尝试安装 fbprophet。我安装了 python3.7 dev、libpcap-dev libpq-dev 并使用此命令构建要点 RUN apt-get install -y python3-pip libsm6 libxext6 python3.7-dev build-essential libncursesw5-dev libssl-dev libgdbm-dev libc6-dev libsqlite3-dev libbz2-dev libffi-dev zlib1g-dev libpcap-dev libpq-dev

然后我按照以下方式安装了以下软件包

RUN pip3 install numpy==1.19.5
RUN pip3 install pandas==1.1.5
RUN pip3 install Pillow==8.2.0
RUN pip3 install PyMeeus==0.5.11
RUN pip3 install pyparsing==2.4.7
RUN pip3 install cmdstanpy==0.9.5 Cython==0.29.3 ephem==4.0.0.2 hijri_converter==2.1.3 convertdate==2.3.2 korean_lunar_calendar==0.2.1 lunarcalendar==0.0.9 holidays==0.11.1 cython tqdm==4.61.1 pystan==2.17.1

最后我尝试安装 fbprohet 0.7.1,但随后出现以下错误:

错误:命令'x86_64-linux-gnu-gcc'失败,退出状态为4 我尝试研究这个问题,常见的解决方案似乎是安装 python3.x-dev、build Essentials 和 libpcap-dev libpq-dev,我已经安装了。

我已经研究这个问题很长一段时间了,但这个错误消息仍然存在,有什么解决办法吗?

编辑: 这是完整的错误消息:

   command: /usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-yc4ch36e/fbprophet_6cbb80365f414249ac2d886e0e6a654d/setup.py'"'"'; __file__='"'"'/tmp/pip-install-yc4ch36e/fbprophet_6cbb80365f414249ac2d886e0e6a654d/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-hv6ghna1
       cwd: /tmp/pip-install-yc4ch36e/fbprophet_6cbb80365f414249ac2d886e0e6a654d/
  Complete output (19 lines):
  /usr/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type'
    warnings.warn(msg)
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib
  creating build/lib/fbprophet
  creating build/lib/fbprophet/stan_model
  DIAGNOSTIC(S) FROM PARSER:
  Warning: left-hand side variable (name=cp_idx) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
  Warning: left-hand side variable (name=m_pr) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
  
  INFO:pystan:COMPILING THE C++ CODE FOR MODEL anon_model_dfdaf2b8ece8a02eb11f050ec701c0ec NOW.
  /usr/local/lib/python3.6/dist-packages/Cython/Compiler/Main.py:367: FutureWarning:
  
  Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /tmp/tmpwga4ct8b/stanfit4anon_model_dfdaf2b8ece8a02eb11f050ec701c0ec_6094426740594523141.pyx
  
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 4
  ----------------------------------------
  ERROR: Failed building wheel for fbprophet
```

I have a docker image based on ubuntu 18.04, where I am trying to install fbprophet. I installed python3.7 dev, libpcap-dev libpq-dev and build essentials with this command
RUN apt-get install -y python3-pip libsm6 libxext6 python3.7-dev build-essential libncursesw5-dev libssl-dev libgdbm-dev libc6-dev libsqlite3-dev libbz2-dev libffi-dev zlib1g-dev libpcap-dev libpq-dev

I then installed following packages in the following way

RUN pip3 install numpy==1.19.5
RUN pip3 install pandas==1.1.5
RUN pip3 install Pillow==8.2.0
RUN pip3 install PyMeeus==0.5.11
RUN pip3 install pyparsing==2.4.7
RUN pip3 install cmdstanpy==0.9.5 Cython==0.29.3 ephem==4.0.0.2 hijri_converter==2.1.3 convertdate==2.3.2 korean_lunar_calendar==0.2.1 lunarcalendar==0.0.9 holidays==0.11.1 cython tqdm==4.61.1 pystan==2.17.1

Finally I tried to install fbprohet 0.7.1, but then I get the following error:

error: command 'x86_64-linux-gnu-gcc' failed with exit status 4
I have tried researching this issue, and the common solution seemed to be to install python3.x-dev, build essentials and libpcap-dev libpq-dev, which I have already.

I am researching this issue for quite some time now, but this error message persists, is there any solution to it?

Edit:
This is the full error message:

   command: /usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-yc4ch36e/fbprophet_6cbb80365f414249ac2d886e0e6a654d/setup.py'"'"'; __file__='"'"'/tmp/pip-install-yc4ch36e/fbprophet_6cbb80365f414249ac2d886e0e6a654d/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-hv6ghna1
       cwd: /tmp/pip-install-yc4ch36e/fbprophet_6cbb80365f414249ac2d886e0e6a654d/
  Complete output (19 lines):
  /usr/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type'
    warnings.warn(msg)
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib
  creating build/lib/fbprophet
  creating build/lib/fbprophet/stan_model
  DIAGNOSTIC(S) FROM PARSER:
  Warning: left-hand side variable (name=cp_idx) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
  Warning: left-hand side variable (name=m_pr) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.
  
  INFO:pystan:COMPILING THE C++ CODE FOR MODEL anon_model_dfdaf2b8ece8a02eb11f050ec701c0ec NOW.
  /usr/local/lib/python3.6/dist-packages/Cython/Compiler/Main.py:367: FutureWarning:
  
  Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /tmp/tmpwga4ct8b/stanfit4anon_model_dfdaf2b8ece8a02eb11f050ec701c0ec_6094426740594523141.pyx
  
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 4
  ----------------------------------------
  ERROR: Failed building wheel for fbprophet
```

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文