1

我有一个刚刚安装 profanity_check 的环境,但是当我运行代码时出现错误:

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)

我搜索了stackoverflow,但出现了更多错误。

谢谢你的阅读:D

4

1 回答 1

0

试试这个:

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

详情在这里:https ://github.com/vzhou842/profanity-check/issues/28

于 2021-09-29T13:48:59.927 回答