polylearn icon indicating copy to clipboard operation
polylearn copied to clipboard

No module polylearn.loss_fast

Open msh-tf opened this issue 8 years ago • 6 comments

`In [1]: import polylearn

ImportError Traceback (most recent call last) in () ----> 1 import polylearn

/Users/manas/projects/polylearn/polylearn/init.py in () ----> 1 from .factorization_machine import FactorizationMachineRegressor 2 from .factorization_machine import FactorizationMachineClassifier 3 from .polynomial_network import PolynomialNetworkRegressor 4 from .polynomial_network import PolynomialNetworkClassifier

/Users/manas/projects/polylearn/polylearn/factorization_machine.py in () 22 from lightning.impl.dataset_fast import get_dataset 23 ---> 24 from .base import _BasePoly, _PolyClassifierMixin, _PolyRegressorMixin 25 from .kernels import _poly_predict 26 from .cd_direct_fast import _cd_direct_ho

/Users/manas/projects/polylearn/polylearn/base.py in () 10 from sklearn.externals import six 11 ---> 12 from .loss import CLASSIFICATION_LOSSES, REGRESSION_LOSSES 13 14

/Users/manas/projects/polylearn/polylearn/loss.py in () 2 # License: Simplified BSD 3 ----> 4 from .loss_fast import Squared, SquaredHinge, Logistic 5 6

ImportError: No module named 'polylearn.loss_fast'`

msh-tf avatar Jan 30 '17 20:01 msh-tf

Did you run python setup.py build at the project root? Do you have Cython installed?

mblondel avatar Feb 02 '17 13:02 mblondel

Actually I realized we're bundling the .cpp files so I don't think Cython is an install dependency. I updated the readme accordingly.

vene avatar Feb 26 '17 23:02 vene

@msh-tf are you still having issues?

vene avatar Apr 24 '17 22:04 vene

Hi @vene, I'm seeing the same issue. I'm attaching the stdout/stderr in a text file so you can see specifics of my install, in case that helps you debug.

stdout_stderr.txt

xenocyon avatar Apr 27 '17 00:04 xenocyon

I think the problem is you're trying to import polylearn from the source directory. This does not work. Try:

mkdir newdir; cd newdir; python -c "import polylearn"

In practice your scripts using polylearn should be in their own packages elsewhere on disk anyway. Let me know if this works.

vene avatar Apr 27 '17 00:04 vene

Thank you @vene ; that resolves my issue!

xenocyon avatar Apr 27 '17 20:04 xenocyon