0.5.0 import errors

286 views
Skip to first unread message

VincentAB

unread,
Jun 26, 2013, 10:15:45 AM6/26/13
to pystat...@googlegroups.com
Hi, 

I just built master statsmodels on an EC2 machine and got a bunch of import errors all related to these two things:

ERROR: Failure: ImportError (cannot import name kalman_loglike)
ERROR: Failure: ImportError (No module named linbin)

Full log here: https://gist.github.com/vincentarelbundock/5867694

Version details:

Description: Ubuntu 12.04.2 LTS
In [4]: numpy.__version__
Out[4]: '1.7.1'
In [6]: scipy.__version__
Out[6]: '0.9.0'
In [8]: statsmodels.__version__
Out[8]: '0.5.0.dev-947943d'
In [11]: pandas.__version__
Out[11]: '0.11.0'

VincentAB

unread,
Jun 26, 2013, 10:17:06 AM6/26/13
to pystat...@googlegroups.com
Oh, and this one too: 

ERROR: Failure: ImportError (No module named _smoothers_lowess) 

josef...@gmail.com

unread,
Jun 26, 2013, 10:22:39 AM6/26/13
to pystat...@googlegroups.com
Thank you for testing.

These are our three cython based extensions.

Are they getting build during the install?

How does the install on an EC2 machine work? I have no idea.

Josef

Vincent Arel

unread,
Jun 26, 2013, 10:39:03 AM6/26/13
to pystat...@googlegroups.com
Cython builds are black magic to me. How would I know if they're getting built? 

For example, I see this: 

% pwd
/home/ubuntu/statsmodels/statsmodels/nonparametric

% ls
api.py   bandwidths.py   __init__.py   kde.py   kdetools.py   _kernel_base.py    kernel_regression.py  linbin.c    _smoothers_lowess.c      smoothers_lowess.py   _smoothers_lowess.pyx
api.pyc  bandwidths.pyc  __init__.pyc  kde.pyc  kdetools.pyc  kernel_density.py  kernels.py            linbin.pyx  smoothers_lowess_old.py  smoothers_lowess.pyc  tests


How does the install on an EC2 machine work? I have no idea.

It's just like a regular headless ubuntu. You can "apt-get install cython" to get 0.15.1 installed or "pip install cython" to get 0.19. I tried with both of those installed and go the same results each times. 


Josef

josef...@gmail.com

unread,
Jun 26, 2013, 10:48:08 AM6/26/13
to pystat...@googlegroups.com
The install log should show that gcc or whatever compiler is called,
and builds the `xxx.pyd` files


>
> For example, I see this:
>
> % pwd
> /home/ubuntu/statsmodels/statsmodels/nonparametric
>
> % ls
> api.py bandwidths.py __init__.py kde.py kdetools.py
> _kernel_base.py kernel_regression.py linbin.c _smoothers_lowess.c
> smoothers_lowess.py _smoothers_lowess.pyx
> api.pyc bandwidths.pyc __init__.pyc kde.pyc kdetools.pyc
> kernel_density.py kernels.py linbin.pyx smoothers_lowess_old.py
> smoothers_lowess.pyc tests

_smoothers_lowess.pyd is missing, so the extension didn't get build
the .c file is there so it looks like it called cython to create them


>
>>
>> How does the install on an EC2 machine work? I have no idea.
>
>
> It's just like a regular headless ubuntu. You can "apt-get install cython"
> to get 0.15.1 installed or "pip install cython" to get 0.19. I tried with
> both of those installed and go the same results each times.

How did you install statsmodels?

pip install statsmodels
should build the extensions, I think
or, if there is a install problem then it should abort.

To me it looks like you are running statsmodels from the source, not
an installed version.

Josef

>
>>
>> Josef
>
>

Skipper Seabold

unread,
Jun 26, 2013, 11:22:31 AM6/26/13
to pystat...@googlegroups.com
They will be .so files on linux. Tough to tell without the build log.
I thought we would bail out sooner without a compiler though, so based
on the below it looks like maybe you're trying to import in the source
tree? You can do an inplace build with

python setup.py build_ext --inplace

Vincent Arel

unread,
Jun 26, 2013, 11:43:52 AM6/26/13
to pystat...@googlegroups.com
Yeah, that was it, trying to run from source. I should have changed directory. No more errors or failures.

Sorry for the trouble. I promise I'll get better at this eventually...

Vincent

josef...@gmail.com

unread,
Jun 26, 2013, 11:49:20 AM6/26/13
to pystat...@googlegroups.com
After a few years working with open source you will be able to spot it
right away. :)

We are allowed to learn from our mistakes. (and leave a paper trail so
the next one can google)

Josef

>
> Vincent
Reply all
Reply to author
Forward
0 new messages