Skip to content

Instantly share code, notes, and snippets.

@Carreau
Created November 19, 2013 13:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Carreau/7545432 to your computer and use it in GitHub Desktop.
Save Carreau/7545432 to your computer and use it in GitHub Desktop.
crash statmodels
In [1]: import pyximport
(reverse-i-search)`pyxi': import pyximport
KeyboardInterrupt
In [2]: pyximport.install()
Out[2]: (None, <pyximport.pyximport.PyxImporter at 0x10e3bdfd0>)
In [3]: import statsmodels.api as sm
/Users/matthiasbussonnier/.pyxbld/temp.macosx-10.7-x86_64-2.7/pyrex/statsmodels/tsa/kalmanf/kalman_loglike.c:321:10: fatal error: 'numpy/arrayobject.h' file not found
#include "numpy/arrayobject.h"
^
1 error generated.
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-3-6030a6549dc0> in <module>()
----> 1 import statsmodels.api as sm
/usr/local/lib/python2.7/site-packages/statsmodels/api.py in <module>()
10 from .discrete.discrete_model import (Poisson, Logit, Probit, MNLogit,
11 NegativeBinomial)
---> 12 from .tsa import api as tsa
13 from .nonparametric import api as nonparametric
14 import distributions
/usr/local/lib/python2.7/site-packages/statsmodels/tsa/api.py in <module>()
----> 1 from .ar_model import AR
2 from .arima_model import ARMA, ARIMA
3 import vector_ar as var
4 from .vector_ar.var_model import VAR
5 from .vector_ar.svar_model import SVAR
/usr/local/lib/python2.7/site-packages/statsmodels/tsa/ar_model.py in <module>()
16 from statsmodels.tools.numdiff import (approx_fprime, approx_hess,
17 approx_hess_cs)
---> 18 from statsmodels.tsa.kalmanf.kalmanfilter import KalmanFilter
19 import statsmodels.base.wrapper as wrap
20 from statsmodels.tsa.vector_ar import util
/usr/local/lib/python2.7/site-packages/statsmodels/tsa/kalmanf/__init__.py in <module>()
----> 1 from kalmanfilter import KalmanFilter
/usr/local/lib/python2.7/site-packages/statsmodels/tsa/kalmanf/kalmanfilter.py in <module>()
30 from numpy.linalg import inv, pinv
31 from statsmodels.tools.tools import chain_dot
---> 32 from . import kalman_loglike
33
34 #Fast filtering and smoothing for multivariate state space models
/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython-0.20dev-py2.7-macosx-10.7-x86_64.egg/pyximport/pyximport.pyc in load_module(self, fullname)
429 self.pyxbuild_dir,
430 build_inplace=self.inplace,
--> 431 language_level=self.language_level)
432 return module
433
/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython-0.20dev-py2.7-macosx-10.7-x86_64.egg/pyximport/pyximport.pyc in load_module(name, pyxfilename, pyxbuild_dir, is_package, build_inplace, language_level, so_path)
207 module_name = name
208 so_path = build_module(module_name, pyxfilename, pyxbuild_dir,
--> 209 inplace=build_inplace, language_level=language_level)
210 mod = imp.load_dynamic(name, so_path)
211 if is_package and not hasattr(mod, '__path__'):
/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython-0.20dev-py2.7-macosx-10.7-x86_64.egg/pyximport/pyximport.pyc in build_module(name, pyxfilename, pyxbuild_dir, inplace, language_level)
184 setup_args=sargs,
185 inplace=inplace,
--> 186 reload_support=pyxargs.reload_support)
187 assert os.path.exists(so_path), "Cannot find: %s" % so_path
188
/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython-0.20dev-py2.7-macosx-10.7-x86_64.egg/pyximport/pyxbuild.pyc in pyx_to_dll(filename, ext, force_rebuild, build_in_temp, pyxbuild_dir, setup_args, reload_support, inplace)
102 try:
103 obj_build_ext = dist.get_command_obj("build_ext")
--> 104 dist.run_commands()
105 so_path = obj_build_ext.get_outputs()[0]
106 if obj_build_ext.inplace:
/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.pyc in run_commands(self)
951 """
952 for cmd in self.commands:
--> 953 self.run_command(cmd)
954
955 # -- Methods that operate on its Commands --------------------------
/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.pyc in run_command(self, command)
970 cmd_obj = self.get_command_obj(command)
971 cmd_obj.ensure_finalized()
--> 972 cmd_obj.run()
973 self.have_run[command] = 1
974
/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython-0.20dev-py2.7-macosx-10.7-x86_64.egg/Cython/Distutils/build_ext.pyc in run(self)
161 optimization.disable_optimization()
162
--> 163 _build_ext.build_ext.run(self)
164
165 def build_extensions(self):
/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build_ext.pyc in run(self)
337
338 # Now actually compile and link everything.
--> 339 self.build_extensions()
340
341 def check_extensions_list(self, extensions):
/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython-0.20dev-py2.7-macosx-10.7-x86_64.egg/Cython/Distutils/build_ext.pyc in build_extensions(self)
169 for ext in self.extensions:
170 ext.sources = self.cython_sources(ext.sources, ext)
--> 171 self.build_extension(ext)
172
173 def cython_sources(self, sources, extension):
/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build_ext.pyc in build_extension(self, ext)
496 debug=self.debug,
497 extra_postargs=extra_args,
--> 498 depends=ext.depends)
499
500 # XXX -- this is a Vile HACK!
/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/ccompiler.pyc in compile(self, sources, output_dir, macros, include_dirs, debug, extra_preargs, extra_postargs, depends)
572 except KeyError:
573 continue
--> 574 self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
575
576 # Return *all* object filenames, not just the ones we just built.
/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/unixccompiler.pyc in _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts)
120 extra_postargs)
121 except DistutilsExecError, msg:
--> 122 raise CompileError, msg
123
124 def create_static_lib(self, objects, output_libname,
ImportError: Building module statsmodels.tsa.kalmanf.kalman_loglike failed: ["CompileError: command 'cc' failed with exit status 1\n"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment