kawingkelvin
kawingkelvin

Reputation: 3971

Cannot import sklearn_pandas in Google AI Platform Notebook after pip install

I am playing around with Google's AI Platform Notebook (which is still in beta at the moment). I uploaded a python script that has dependency on sklearn_pandas and I am getting this error:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-4-24f79569b871> in <module>
----> 1 from sklearn_pandas import DataFrameMapper

ImportError: No module named 'sklearn_pandas'

I then try to pip install it:

!pip install sklearn-pandas

I restarted the kernel but it is still getting same ImportError. I did this to confirm sklearn pandas is really installed:

!pip list |grep -i sklearn

DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
sklearn-pandas (1.8.0)

Anyone has tried this? I used google colab before this, and I never have such difficulty. It will be great if Google colab level of user experience can be ported into this beta product. I think this could be a general python module importing issue than just sklearn_pandas in particular.

Upvotes: 1

Views: 3970

Answers (1)

kawingkelvin
kawingkelvin

Reputation: 3971

i think it may be

%pip install sklearn-pandas

instead of "!pip".

Upvotes: 2

Related Questions