【问题标题】:Error installing FBPROPHET in my windows machine在我的 Windows 机器上安装 FBPROPHET 时出错
【发布时间】:2022-07-04 00:05:45
【问题描述】:

我在 Windows 环境中安装 fbprophet 时遇到下面提到的错误,并且由于使用 wheel 文件的安装失败,setup.py 也作为安装的一部分被触发。

安装 fbprophet 库: 对 fbprophet 使用旧版“setup.py install”,因为未安装包“wheel”

(new_venv) C:\Users\anno_user\Downloads\DocumentDB-Quickstart-Python>pip install fbprophet
Collecting fbprophet
  Using cached fbprophet-0.7.1.tar.gz (64 kB)
  Preparing metadata (setup.py) ... done

Using legacy 'setup.py install' for fbprophet, since package 'wheel' is not installed.
Installing collected packages: fbprophet
  Running setup.py install for fbprophet ... error
  error: subprocess-exited-with-error

当 setup.py 安装软件包时,我们收到以下错误:


  × Running setup.py install for fbprophet did not run successfully.
  │ exit code: 1
  ╰─> [45 lines of output]
      running install
      c:\users\anno_user\downloads\documentdb-quickstart-python\new_venv\lib\site-packages\setuptools\command\install.py:37: SetuptoolsDeprecationWarning: se
tup.py install is deprecated. Use build and pip and other standards-based tools.
        setuptools.SetuptoolsDeprecationWarning,
      running build
      running build_py
      Traceback (most recent call last):
        File "<string>", line 36, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\anno_user\AppData\Local\Temp\pip-install-hvgs_7ri\fbprophet_7865d66523254cabae59b7777322c65d\setup.py", line 149, in <module>
          long_description_content_type='text/markdown',
        File "C:\Users\anno_user\AppData\Local\Temp\pip-install-hvgs_7ri\fbprophet_7865d66523254cabae59b7777322c65d\fbprophet\models.py", line 209, in build_
model
          import pystan
        File "c:\users\anno_user\downloads\documentdb-quickstart-python\new_venv\lib\site-packages\pystan\__init__.py", line 9, in <module>
          from pystan.api import stanc, stan
        File "c:\users\anno_user\downloads\documentdb-quickstart-python\new_venv\lib\site-packages\pystan\api.py", line 13, in <module>
          import pystan._api  # stanc wrapper
      ImportError: DLL load failed: The specified module could not be found.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> fbprophet

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

如果有任何解决方法(或)解决我所面临的问题,请提出建议。另外,请提及 python 版本以及用于从 pypi.org 安装 fbprophet 的依赖项版本。

【问题讨论】:

  • 据我记得,您需要 Anaconda,因为它有一个独立的构建系统和自己的 C++ 编译器。使用 Anaconda 应该会有所帮助。
  • @annabednarsha,我也这么觉得,我们正在寻找在 Linux 环境中安装 anaconda 来解决这个错误。

标签: python pip time-series facebook-prophet


【解决方案1】:

您可以按照this instruction 在 Windows 上安装 Anaconda,然后在 Anaconda Prompt 中运行以下命令(以管理员身份):

conda install -c conda-forge gcc
conda install -c conda-forge pystan
conda install -c conda-forge fbprophet

【讨论】:

    【解决方案2】:

    确保您使用的是 python 3.7 或 3.8

    【讨论】:

      【解决方案3】:

      这些命令不再起作用。

      a) "fbprophet" 现在是 "prophet"

      b) 需要旧版本的 pystan 和 cmdstanpy

      pystan=2.19.1.1 cmdstanpy=0.9.5

      我的 Windows 操作系统无法安装 pystan=2.19.1.1 所以我放弃了。但是“pip install知者”在 Google Collab 和 GCP Workbench 上都可以使用。

      【讨论】:

      【解决方案4】:

      一种解决方法是安装“prophet”模块而不是“fbprophet” 并且在导入 import 'prophet' 而不是 'fbprophet' 所以

      python3 -m  pip install pystan
      python3 -m  pip install prophet
      

      或者干脆

      pip install pystan
      pip install prophet
      

      【讨论】:

        猜你喜欢
        • 2023-01-07
        • 2019-04-10
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-01-28
        • 1970-01-01
        • 2015-09-29
        相关资源
        最近更新 更多