- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
CDSW - ModuleNotFoundError: No module named 'sklearn'
Created on 06-30-2020 06:11 AM - edited 06-30-2020 06:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi
a newbie question...
i'm trying to follow the guide here (using CDSW 1.7) : https://www.cloudera.com/tutorials/building-a-linear-regression-model-for-predicting-house-prices.ht...
when i add the following
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.datasets import load_boston
from sklearn.metrics import mean_squared_error, r2_score
i get the ModuleNotFoundError :
ModuleNotFoundError: No module named 'sklearn'
ModuleNotFoundError Traceback (most recent call last) in engine ----> 1 from sklearn.model_selection import train_test_split ModuleNotFoundError: No module named 'sklearn'
how can i solve this?
thanks
Created on 06-30-2020 08:01 AM - edited 06-30-2020 08:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can do this:
!pip3 install sklearn
This will install the needed package. Note that ! is a magic command that executes the command not in your Python session but in the underlying OS environment.