簡體   English   中英

將 import texthero 作為 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'

似乎與較新版本的gensim存在潛在沖突,在我的情況下為 4.0.1。

pip install "gensim==3.8.1"

為我解決了這個問題。

嘗試

pip install -U gensim

pip install texthero

新版本有點問題。 嘗試安裝舊版本。 pip install texthero==1.0.5 --> 它會變魔術

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM