Prophet: ImportError: cannot import name 'pythran_is_numpy_func_supported'

Created on 18 Apr 2019  路  5Comments  路  Source: facebook/prophet

Can not import using from fbprophet import Prophet. I am testing fbprophet for the first time, using a Jupyter Notebook for test and I run into error message below. I couldn't find any resource to debug this in context to fbprophet, please point me to the resource, if available.

Error message

ImportError                               Traceback (most recent call last)
<ipython-input-1-e883718a76d3> in <module>
      9 import matplotlib.pyplot as plt
     10 import Cython
---> 11 from fbprophet import Prophet

~\AppData\Local\Continuum\anaconda3\envs\tensorflow\lib\site-packages\fbprophet\__init__.py in <module>
      6 # of patent rights can be found in the PATENTS file in the same directory.
      7 
----> 8 from fbprophet.forecaster import Prophet
      9 
     10 __version__ = '0.4'

~\AppData\Local\Continuum\anaconda3\envs\tensorflow\lib\site-packages\fbprophet\forecaster.py in <module>
     15 import numpy as np
     16 import pandas as pd
---> 17 import pystan  # noqa F401
     18 
     19 from fbprophet.diagnostics import prophet_copy

~\AppData\Local\Continuum\anaconda3\envs\tensorflow\lib\site-packages\pystan\__init__.py in <module>
      7 import logging
      8 
----> 9 from pystan.api import stanc, stan
     10 from pystan.misc import read_rdump, stan_rdump, stansummary
     11 from pystan.model import StanModel

~\AppData\Local\Continuum\anaconda3\envs\tensorflow\lib\site-packages\pystan\api.py in <module>
     13 import pystan._api  # stanc wrapper
     14 from pystan._compat import string_types, PY2
---> 15 from pystan.model import StanModel
     16 
     17 logger = logging.getLogger('pystan')

~\AppData\Local\Continuum\anaconda3\envs\tensorflow\lib\site-packages\pystan\model.py in <module>
     30 
     31 import Cython
---> 32 from Cython.Build.Inline import _get_build_extension
     33 from Cython.Build.Dependencies import cythonize
     34 

~\AppData\Local\Continuum\anaconda3\envs\tensorflow\lib\site-packages\Cython\Build\Inline.py in <module>
     15 from ..Compiler.Main import Context, CompilationOptions, default_options
     16 
---> 17 from ..Compiler.ParseTreeTransforms import (CythonTransform,
     18         SkipDeclarations, AnalyseDeclarationsTransform, EnvTransform)
     19 from ..Compiler.TreeFragment import parse_from_strings

~\AppData\Local\Continuum\anaconda3\envs\tensorflow\lib\site-packages\Cython\Compiler\ParseTreeTransforms.py in <module>
     12 from . import PyrexTypes
     13 from . import Naming
---> 14 from . import ExprNodes
     15 from . import Nodes
     16 from . import Options

~\AppData\Local\Continuum\anaconda3\envs\tensorflow\lib\site-packages\Cython\Compiler\ExprNodes.py in <module>
     44 from .DebugFlags import debug_disposal_code, debug_temp_alloc, \
     45     debug_coercion
---> 46 from .Pythran import (to_pythran, is_pythran_supported_type, is_pythran_supported_operation_type,
     47      is_pythran_expr, pythran_func_type, pythran_binop_type, pythran_unaryop_type, has_np_pythran,
     48      pythran_indexing_code, pythran_indexing_type, is_pythran_supported_node_or_none, pythran_type,

ImportError: cannot import name 'pythran_is_numpy_func_supported'

Thanks for all the help.

Most helpful comment

pip uninstall cython--> repeatedly until your system is clear

then
pip install cython

All 5 comments

This is a cython package issue. I was able to correctly import fbprophet with cython 0.29.6

Closing the issue.

pip uninstall cython--> repeatedly until your system is clear

then
pip install cython

in my case.

ImportError: cannot import name 'Prophet' from partially initialized module 'fbprophet' (most likely due to a circular import) (/Users/Naropa/Downloads/python/fbprophet.py)

runfile('/Users/Naropa/Downloads/python/Euxusd.py', wdir='/Users/Naropa/Downloads/python')
Traceback (most recent call last):

File "/Users/Naropa/Downloads/python/Euxusd.py", line 11, in
from fbprophet import Prophet

File "/Users/Naropa/Downloads/python/fbprophet.py", line 10, in
from fbprophet import Prophet

please help..

please create a new ticket and add the full stacktrace

Was this page helpful?
0 / 5 - 0 ratings