ModuleNotFoundError: No module named 'sklearn.linear_model.base' ERROR PYTHON - python

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.

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

Related

Python: Numpy version is not downgrading

I am trying to import the keras library which causes the following error code:
AttributeError: module 'numpy' has no attribute 'typeDict'
Already found the reason for the error:
This means you are using a NumPy version that removed the deprecated ways AND the library you are using wasn't updated to match that version (uses something like np.typeDict instead of np.sctypeDict).
I wanted to downgrade numpy to an older version (1.21) to fix the issue.
BUT no matter what I am trying to downgrade numpy, it seems like it's stuck on version 1.24.1.
When trying pip3 install --upgrade numpy==1.21 in the terminal it says:
Requirement already up-to-date: numpy==1.21 in ./opt/anaconda3/lib/python3.8/site-packages (1.21.0)
But when checking the numpy version in my editor with import numpy print(numpy.__version__)it's still version 1.24.1. I have already uninstalled the numpy package and reinstalled the older version but nothing changes. What am I doing wrong?

No module named 'scipy.signal'

Whenever I am trying to import scipy.signal it gives the following error
No module named 'scipy.signal'
I am currently on python 3.9 and 1.9.3 for scipy.I have tried uninstalling and reinstalling scipy
Well I solved the problem by completely uninstalling python and reinstalling it

Why aren't transformers imported in Python?

I want to import transformers in jupyter notebook but I get the following error. What is the reason for this error? My Python version is 3.8
ImportError: cannot import name 'TypeAlias' from 'typing_extensions'
I also updated the typing-extensions library version, but the problem was not resolved
You could try
pip install typing-extensions --upgrade
maybe the probelm is the version of datasets package:
pip install datasets==1.15
TypeAlias is available from python version 3.10.
You should upgrade your python version to avoid the error.

AttributeError while loading textHero library

I am getting an error when importing textHero
#import the texthero library
import texthero as hero
import pandas as pd
Error : AttributeError: module 'nltk' has no attribute 'data'
I have installed textHero again but error did not get resolved.
Can you please post the whole error message?
Anyway, you should be able to solve the problem by uninstalling and installing again NLTK:
pip uninstall nltk
pip install -U nltk
Specify the gensim version to 3.8. worked for me
After importing the "texthero" library. It showed an error message:
ModuleNotFoundError: No module named 'gensim.sklearn_api'
I have tried to install 'gensim.sklearn_api', but no such module available yet.
Also, created the new anaconda environment for an older version of python-like 3.6 and 3.7 but It showed the same error message.
I have installed the older version of texthero and its work
pip install texthero==1.0.5
The older version of texthero==1.0.5 is very much compatible with python version like 3.6, 3.7 and 3.8
[![enter image description here][2]][2]

does nolearn/lasagne support python 3

I am working with Neural Net implementation in nolearn.lasagne as mentioned here
However I get the following error:
ImportError: No module named 'cPickle'
I figure out that cPickle is pickle in python-3
Does nolearn/lasagne support python-3 ? If not, is there any workaround ?
You seem to be using an older version of nolearn. Try the current master from Github with these commands:
pip uninstall nolearn
pip install https://github.com/dnouri/nolearn/archive/master.zip#egg=nolearn
Here's the tests in master running with both Python 2.7 and 3.4: https://travis-ci.org/dnouri/nolearn/builds/61806852

Categories

Resources