profanity check error cannot import name 'joblib' from 'sklearn.externals'

2.8k views Asked by At

I have a env that I just Installed profanity_check but when I run my code I get a error:

Traceback (most recent call last):
  File "bot.py", line 1, in <module>
    from profanity_check import predict, predict_prob
  File "D:\bot\bot\lib\site-packages\profanity_check\__init__.py", line 1, in <module>
    from .profanity_check import predict, predict_prob
  File "D:\bot\bot\lib\site-packages\profanity_check\profanity_check.py", line 3, in <module>     
    from sklearn.externals import joblib
ImportError: cannot import name 'joblib' from 'sklearn.externals' (D:\bot\bot\lib\site-packages\sklearn\externals\__init__.py)

I searched into stackoverflow but I get more errors.

thank you for reading :D

1

There are 1 answers

0
user17034129 On

Try this out :

    pip install alt-profanity-check
    pip install sklearn --upgrade
    from profanity_check import predict, predict_prob

Details here : https://github.com/vzhou842/profanity-check/issues/28