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
459 stars 122 forks source link

Failed to load Earth after having successfully installed py-earth... #187

Open jiapei100 opened 6 years ago

jiapei100 commented 6 years ago

ERROR messages:

>>> from pyearth import Earth
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "....../py-earth/pyearth/__init__.py", line 6, in <module>
    from .earth import Earth
  File "....../py-earth/pyearth/earth.py", line 1, in <module>
    from ._forward import ForwardPasser
ModuleNotFoundError: No module named 'pyearth._forward'

Any suggestions? Pei

jcrudy commented 6 years ago

@jiapei100 This seems to happen when people try to run python from within the py-earth source directory after installing. Could that be the problem in your case?

mk123qwe commented 6 years ago

@jcrudy hi,I met the same problem

Using d:\program files\anaconda3\lib\site-packages Searching for scikit-learn==0.18.2 Best match: scikit-learn 0.18.2 Adding scikit-learn 0.18.2 to easy-install.pth file

Using d:\program files\anaconda3\lib\site-packages Searching for scipy==1.1.0 Best match: scipy 1.1.0 Adding scipy 1.1.0 to easy-install.pth file

Using d:\program files\anaconda3\lib\site-packages Finished processing dependencies for sklearn-contrib-py-earth==0.1.0

d:\research\py-earth>python Python 3.6.6 |Anaconda, Inc.| (default, Jun 28 2018, 11:27:44) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

from pyearth import Earth Traceback (most recent call last): File "", line 1, in File "d:\research\py-earth\pyearth__init__.py", line 6, in from .earth import Earth File "d:\research\py-earth\pyearth\earth.py", line 1, in from ._forward import ForwardPasser ModuleNotFoundError: No module named 'pyearth._forward'

jcrudy commented 5 years ago

@mk123qwe Sorry for the delay. I believe you are dealing with the same problem as @jiapei100. If you run Python from a different directory it should solve your problem.