【问题标题】:Not able to install fbprophet within pycharm无法在 pycharm 中安装 fbprophet
【发布时间】:2019-12-30 16:24:19
【问题描述】:

您好,我是 python 新手,正在尝试在 pycharm 中安装 fbprophet,但出现以下错误。不过我已经成功安装了pystan。

Building wheels for collected packages: fbprophet
  Building wheel for fbprophet (setup.py): started
  Building wheel for fbprophet (setup.py): finished with status 'error'
  Running setup.py clean for fbprophet
Failed to build fbprophet
Installing collected packages: fbprophet
  Running setup.py install for fbprophet: started
    Running setup.py install for fbprophet: finished with status 'error'

  ERROR: Command errored out with exit status 1:
   command: 'C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ankita.gupta\\AppData\\Local\\Temp\\pycharm-packaging\\fbprophet\\setup.py'"'"'; __file__='"'"'C:\\Users\\ankita.gupta\\AppData\\Local\\Temp\\pycharm-packaging\\fbprophet\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\ANKITA~1.GUP\AppData\Local\Temp\pip-wheel-9u7mn7vi' --python-tag cp37
       cwd: C:\Users\ankita.gupta\AppData\Local\Temp\pycharm-packaging\fbprophet\
  Complete output (40 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib
  creating build\lib\fbprophet
  creating build\lib\fbprophet\stan_model
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\ankita.gupta\AppData\Local\Temp\pycharm-packaging\fbprophet\setup.py", line 120, in <module>
      """
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\setuptools\__init__.py", line 145, in setup
      return distutils.core.setup(**attrs)
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\distutils\core.py", line 148, in setup
      dist.run_commands()
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\distutils\dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\wheel\bdist_wheel.py", line 192, in run
      self.run_command('build')
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\distutils\command\build.py", line 135, in run
      self.run_command(cmd_name)
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "C:\Users\ankita.gupta\AppData\Local\Temp\pycharm-packaging\fbprophet\setup.py", line 44, in run
      build_stan_model(target_dir)
    File "C:\Users\ankita.gupta\AppData\Local\Temp\pycharm-packaging\fbprophet\setup.py", line 27, in build_stan_model
      from pystan import StanModel
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\site-packages\pystan\__init__.py", line 9, in <module>
      from pystan.api import stanc, stan
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\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. 

关于如何解决它的任何想法,任何人? 非常感谢。

【问题讨论】:

  • 你直接用pip试过了吗?
  • Tim Woocker 是的......给出同样的错误
  • NotSoShabby 这个解决方案对我不起作用。在发布问题之前,我已经浏览过链接

标签: python pycharm dllimport


【解决方案1】:

首先你要安装c++编译器,你可以安装c++编译器

pip install libpython m2w64-toolchain -c msys2

安装 c++ 编译器后,您必须安装 pystan,要安装 pystan,您可以使用以下命令

pip install pystan

最后,现在我们准备安装 facebook 先知

pip install fbprophet

【讨论】:

    【解决方案2】:

    我在 Windows10 Pycharm 虚拟环境上安装 fbprophet 时遇到了同样的问题...

    通过首先卸载我已经安装的任何 pystan、fbprophet 解决了这个问题:

    pip uninstall pystan
    
    pip uninstall fbprophet
    

    然后使用 python.exe 重新安装这些库:

    #PyStan:
    
    python.exe -m pip install pystan==2.17.1.0
    
    #fbProphet0.6:
    
    python.exe -m pip install fbprophet==0.6 
    
    #Upgrade fbProphet:
    
    python.exe -m pip install --upgrade fbprophet
    

    如果你按照这个步骤,property应该安装成功了!

    通过从 python 终端导入库来测试安装:

    Python 3.7.3 
    
    >>> import fbprophet
    >>>
    

    来源:Installing fbprophet Python on Windows 10

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-12-07
      • 2020-04-07
      • 2020-04-18
      • 2016-11-28
      • 2020-04-26
      • 2020-04-12
      • 2015-10-27
      • 1970-01-01
      相关资源
      最近更新 更多