Fbprophet安装错误 - fbprophet的构建轮失败

时间:2018-04-18 00:36:33

标签: python-3.x anaconda facebook-prophet

我正在尝试使用Pip安装为Python安装fbprophet,但失败了。我已经安装了Pystan。

我可以使用Anaconda Navigator导入它吗?

有人可以帮忙。

fbprophet的构建轮失败

Running setup.py clean for fbprophet
Failed to build fbprophet
Installing collected packages: fbprophet
  Running setup.py install for fbprophet ... error
    Complete output from command C:\ProgramData\Anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\SJ-Admin\\AppData\\Local\\Temp\\pip-build-bsm4sxla\\fbprophet\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\SJ-Admin\AppData\Local\Temp\pip-kvck8fw1-record\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib
    creating build\lib\fbprophet
    creating build\lib\fbprophet\stan_models
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\SJ-Admin\AppData\Local\Temp\pip-build-bsm4sxla\fbprophet\setup.py", line 126, in <module>
        """
      File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\__init__.py", line 129, in setup
        return distutils.core.setup(**attrs)
      File "C:\ProgramData\Anaconda3\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\install.py", line 61, in run
        return orig.install.run(self)
      File "C:\ProgramData\Anaconda3\lib\distutils\command\install.py", line 545, in run
        self.run_command('build')
      File "C:\ProgramData\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "C:\ProgramData\Anaconda3\lib\distutils\command\build.py", line 135, in run
        self.run_command(cmd_name)
      File "C:\ProgramData\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "C:\Users\SJ-Admin\AppData\Local\Temp\pip-build-bsm4sxla\fbprophet\setup.py", line 46, in run
        build_stan_models(target_dir)
      File "C:\Users\SJ-Admin\AppData\Local\Temp\pip-build-bsm4sxla\fbprophet\setup.py", line 28, in build_stan_models
        from pystan import StanModel
    ImportError: cannot import name 'StanModel'

5 个答案:

答案 0 :(得分:1)

我可以使用conda install -c conda-forge fbprophet安装fbprophet。 由于许可问题,这也失败了 我的文件夹是只读的#39;权限。我把它修改为读写。然后重新命令并能够安装fbprophet

答案 1 :(得分:1)

使用离线包安装程序:这适用于 Python 3.8。和 Python 3.9.x

pip install localpip 
localpip install fbprophet

答案 2 :(得分:0)

所以我做完

conda install -c conda-forge fbprophe

我到最后了:

EnvironmentNotWritableError: The current user does not have write permissions to the target environment.
  environment location: C:\ProgramData\Anaconda3

ProgramData是系统文件夹,所以更改了r-w权限(花了几分钟),我也对带有Lib文件夹的C:\ Program Files \ Python37路径进行了此操作。

这无济于事 解决方案?

答案 3 :(得分:0)

以下步骤将起作用:

  1. 在提示时安装Ephem:

    conda install -c anaconda ephem
    
  2. 安装Pystan:

    conda install -c conda-forge pystan
    
  3. 最终安装Fbprophet:

    conda install -c conda-forge fbprophet
    

参考:https://github.com/facebook/prophet/issues/892

答案 4 :(得分:-1)

经过大量研究,我找到了在Windows 10上安装fbprophet的解决方案。

步骤1:在jupyter中检查内核。 找到文件夹\ jupyter \ kernels \ python3并检查内核使用的python exe位置。 我的指向-Programs \ Python \ Python37 \ python.exe 打开CMD提示符,然后转到目录上方。

我已跳过pystan安装,因为我已经使用pip命令安装了pystan。

第2步:从https://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted下载文件“ Twisted-20.3.0-cp37-cp37m-win_amd64.whl”

python -m pip install /Twisted-20.3.0-cp37-cp37m-win_amd64.whl

第3步:pip安装fbprophet

安装收集的软件包:fbprophet 成功安装了fbprophet-0.6

第4步:python

导入fbprophet

fbprophet。版本

'0.6'