Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Cannot import inplace_column_scale #3046

Closed
glouppe opened this issue Apr 9, 2014 · 7 comments
Closed

[BUG] Cannot import inplace_column_scale #3046

glouppe opened this issue Apr 9, 2014 · 7 comments

Comments

@glouppe
Copy link
Contributor

glouppe commented Apr 9, 2014

It seems something is wrong with inplace_column_scale. On the bleeding edge version, the following imports fail on two of my boxes:

In [1]: from sklearn.linear_model  import Lasso
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-41abf34f77f4> in <module>()
----> 1 from sklearn.linear_model  import Lasso

/home/glouppe/anaconda/lib/python2.7/site-packages/sklearn/linear_model/__init__.py in <module>()
     10 # complete documentation.
     11 
---> 12 from .base import LinearRegression
     13 
     14 from .bayes import BayesianRidge, ARDRegression

/home/glouppe/anaconda/lib/python2.7/site-packages/sklearn/linear_model/base.py in <module>()
     28 from ..utils import as_float_array, atleast2d_or_csr, safe_asarray
     29 from ..utils.extmath import safe_sparse_dot
---> 30 from ..utils.sparsefuncs import mean_variance_axis0, inplace_column_scale
     31 
     32 

ImportError: cannot import name inplace_column_scale
@glouppe
Copy link
Contributor Author

glouppe commented Apr 9, 2014

I assume this may also be the reason why documentation is no longer generated for some of the linear models: http://scikit-learn.org/dev/modules/classes.html#sklearn-linear-model-generalized-linear-models

@GaelVaroquaux
Copy link
Member

It seems something is wrong with inplace_column_scale. On the bleeding edge
version, the following imports fail on two of my boxes:

---> 30 from ..utils.sparsefuncs import mean_variance_axis0, inplace_column_scale
31
32

ImportError: cannot import name inplace_column_scale

You need to do a make clean: sparsefuncs.so was replaced by
sparsefuncs.py, but chances are that the .so is still there and leading
to a conflicting import.

@glouppe
Copy link
Contributor Author

glouppe commented Apr 9, 2014

Indeed, this solved my problem. Sorry for the noise.

@glouppe glouppe closed this as completed Apr 9, 2014
@larsoner
Copy link
Contributor

I just ran into the same error. In my case make clean helped, as did removing my previously-installed version before doing python setup.py install --user. I feel like I should have known this... but thanks for pointing out this issue @glouppe and @GaelVaroquaux for the fix!

@denson
Copy link

denson commented May 30, 2014

This worked for me as well. TYVM

@mattivi
Copy link

mattivi commented Nov 25, 2014

on windows platform (32bit) I get the same errore as in the topic. Both on v0.15.1 and on v0.15.2. I've tried both upgrade and clean install.

@amueller
Copy link
Member

@mattivi have you tried removing the whole folder and installing anew?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants