Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: Cannot import name ‘joblib’ from ‘sklearn.externals #52

Closed
htnphu opened this issue Jul 15, 2024 · 1 comment
Closed

Comments

@htnphu
Copy link

htnphu commented Jul 15, 2024

Hello,

I'm encountering an issue while trying to use the profanity_check library in Python. Upon importing profanity_check, I'm receiving the following error:

Traceback (most recent call last):
File “path/to/your/script.py”, line X, in
from profanity_check import predict, predict_prob
File “path/to/venv/lib/pythonX.X/site-packages/profanity_check/init.py”, line X, in
from .profanity_check import predict, predict_prob
File “path/to/venv/lib/pythonX.X/site-packages/profanity_check/profanity_check.py”, line X, in
from sklearn.externals import joblib
ImportError: cannot import name ‘joblib’ from ‘sklearn.externals’ (path/to/venv/lib/pythonX.X/site-packages/sklearn/externals/init.py)

It seems that profanity_check is relying on joblib from sklearn.externals, which has been removed in newer versions of scikit-learn.

Could you please advise on how to resolve this issue? Alternatively, could the library be updated to use joblib directly or provide compatibility with newer versions of scikit-learn?

Thank you for your assistance.

Best regards,
htnphu

@htnphu
Copy link
Author

htnphu commented Jul 15, 2024

Hello,

I have found a solution to the issue. There is a forked repository called alt-profanity-check that addresses the import problem with joblib. This repository is a drop-in replacement for profanity-check and aims to maintain compatibility with newer versions of scikit-learn.

You guys can find the alt-profanity-check repository here: https://github.com/dimitrismistriotis/alt-profanity-check

Best regards,
htnphu

@htnphu htnphu closed this as completed Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant