简体   繁体   中英

Google Colab ModuleNotFoundError: No module named 'sklearn.externals.joblib'

My Initial import looks like this and this code block runs fine.

# Libraries to help with reading and manipulating data
import numpy as np
import pandas as pd

# Libraries to help with data visualization
import matplotlib.pyplot as plt
import seaborn as sns

sns.set()

# Removes the limit for the number of displayed columns
pd.set_option("display.max_columns", None)
# Sets the limit for the number of displayed rows
pd.set_option("display.max_rows", 200)

# to split the data into train and test
from sklearn.model_selection import train_test_split

# to build linear regression_model
from sklearn.linear_model import LinearRegression

# to check model performance
from sklearn.metrics import mean_absolute_error, mean_squared_error, r2_score

But when I try to following command I get the error ModuleNotFoundError: No module named 'sklearn.externals.joblib'

I tried to use.pip to install all the modules and other suggestions for this error it didnt work. This is google colab so not sure what I am missing

import joblib
from mlxtend.feature_selection import SequentialFeatureSelector as SFS

Your code works fine for me on colab, I suggest opening a new instance and trying again, with just this block.

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM