andreas-h / pyloess

loess smoother / stl seasonal trend decomposition, originally from scipy.sandbox.pyloess
Other
56 stars 39 forks source link

No modules named _lowess, _stl, _loess #1

Open garnieje opened 9 years ago

garnieje commented 9 years ago

Hi There,

I have downloaded the pyloess package.
I have run python setup.py build and python setup.py install
When I type import pyloess in the python console, I got ImportError: No module named _lowess. I can not find _stl and _loess as well.
I have a Mac OS X 10.9.3 and Python 2.7.8.
Any ideas where that is coming from?
Many thanks,
Jérôme.

andreas-h commented 9 years ago

sorry for not seeing this earlier ...

and sorry for not being able to help. i forked this repo some long-ish time ago, and never really got to work on it ...

docnick commented 8 years ago

I ran into the same error: ImportError: No module named _lowess because there is a file: pyloess.py in the current directory so that's what python grabs on the import.

However, after renaming that file I ran into a new issue: Traceback (most recent call last): File "examples.py", line 23, in <module> import pyloess File "/usr/local/lib/python2.7/dist-packages/pyloess/__init__.py", line 15, in <module> import pyloess File "/usr/local/lib/python2.7/dist-packages/pyloess/pyloess.py", line 41, in <module> import _lowess, _stl, _loess ImportError: /usr/local/lib/python2.7/dist-packages/pyloess/_loess.so: undefined symbol: drot_

I just came across this package - looks like they interface with R to call STL

rorschachhb commented 8 years ago

@garnieje @andreas-h I think I might know what happened.

This project is named "pyloess", so if you put this project somewhere like "/home/yourname/", and run python console in the same directory, python will first try to import pyloess from your working directory instead of system directory. And there happens to be a "init.py" in "/home/yourname/pyloess",so python will recognise it as a valid python module and try to load it, but python can't find _loess.so in "/home/yourname/pyloss", that's where the ImportError came from.

I simply changed the folder name from "pyloess" to "pyloess-project" and everything is fine now.

I think it would be better to re-arrange the folder and make it look like this: |-- examples.py |-- LICENSE.txt |-- python ----|-- init.py ----|-- pyloess.py ----|-- mpyloess.py |-- README |-- setup.py |-- src |-- tests

vhaasteren commented 8 years ago

There are still problems with linking. After applying this patch on Ubuntu, I get: "ImportError: loess.so: undefined symbol: drot". This happens when trying to import pyloess, with my working directory outside of the source tree of course.

On Windows, I get undefined references to the same linpack routines, but now at compile time: "./src/linpacklite.f:657: undefined reference to 'drot',"

This among other things. Looks like the setup script needs to be modified to link to the blas/lapack directories when compiling/linking the Fortran code. Sorry, but I do not have the ability to help with that right now. I am going to go with the R package for now.