1

I am trying to run the PROJECT on my local machine on pycharm.

I am using Anaconda interpreter. and installed scikit-learn 1.2.0 version. Still, I am getting an error

    __model = pickle.load(f)
ModuleNotFoundError: No module named 'sklearn.linear_model.base'

I have tried to solve using the existing answers answer1 on StackOverflow but none of them worked.

I tried to update the scikit-learn version but every time am getting errors.

S.Ansari
  • 11
  • 2
  • Another similar question: https://stackoverflow.com/questions/59262018/modulenotfounderror-no-module-named-sklearn-linear-model-base – Alexander L. Hayes Dec 29 '22 at 17:15
  • 1
    Welcome to SO! Since it appears you may be new, a word of caution concerning Pickle files, more generally: they allow for arbitrary execution of code. Be very, very careful. I fire up a fresh virtual machine and turn off networking to open up any new pickle file prior to using for anything on my devices or servers. Once you verify safety, then you should save and sign that file locally, effectively verifying its safety yourself. – Jason R Stevens CFA Dec 29 '22 at 18:09

1 Answers1

2

sklearn.linear_model.base was deprecated in 0.22 and removed in 0.24.

Old pickle files are not guaranteed to be compatible with newer versions, so an old version of scikit-learn is probably needed. e.g.:

pip install scikit-learn==0.20.3
Alexander L. Hayes
  • 3,892
  • 4
  • 13
  • 34