导入 import texthero as hero 时出现以下错误

I am getting the following error when importing import texthero as hero

我一直在尝试将 texthero 加载到 python,但一直出现此错误。我已经升级了gensim模块

错误

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-24-0692be95f55a> in <module>()
----> 1 import texthero as hero
      2 import pandas as pd

1 frames
/usr/local/lib/python3.7/dist-packages/texthero/preprocessing.py in <module>()
     22 warnings.filterwarnings(action="ignore", category=UserWarning, module="gensim")
     23 
---> 24 from gensim.sklearn_api.phrases import PhrasesTransformer
     25 
     26 

ModuleNotFoundError: No module named 'gensim.sklearn_api'

尝试

pip install -U gensim

pip install texthero

似乎与更新版本的 gensim 存在潜在冲突,在我的例子中是 4.0.1.

pip install "gensim==3.8.1"

帮我解决了这个问题。