scikit-learn-contrib / py-earth

A Python implementation of Jerome Friedman's Multivariate Adaptive Regression Splines
http://contrib.scikit-learn.org/py-earth/
BSD 3-Clause "New" or "Revised" License
457 stars 122 forks source link

import error #126

Closed florakarniav closed 8 years ago

florakarniav commented 8 years ago

Hi, I get the following error when trying to run the most basic example(in the readme file). Any idea why? Thank you in advance

Traceback (most recent call last): File "example.py", line 2, in from pyearth import Earth File "/home/flo/mars/py-earth/pyearth/init.py", line 8, in from .earth import Earth File "/home/flo/mars/py-earth/pyearth/earth.py", line 1, in from ._forward import ForwardPasser ImportError: No module named _forward

mehdidc commented 8 years ago

Hello,

it looks like the 'so' (_forward.so etc) files are not found. Could you please show the content of directory where py-earth hsas been installed ? you could know it by doing an 'import pyearth;print(pyearth.file)' and list the directory where the shown file is located.

florakarniav commented 8 years ago

Hi and thank you for your response,

it seems that even just 'import pyearth' does not work. This line: _ImportError: No module named forward made me look for issues in the _forward module which is actually a Cython module so the problem was that I need to run my .py with Cython.

PeterJacob commented 7 years ago

I actually got this error as well when I first installed py-earth. Curiously it is no longer a problem after running pip uninstall py-earth, and running python setup.py install again.

jcrudy commented 7 years ago

@PeterJacob For the record, what operating system and python version are you using?

jcharit1 commented 7 years ago

@PeterJacob and @jcrudy I encountered this error too. Try changing out of the py-earth installation directory (i.e. cd ~), then try executing python and importing the package.