Skip to content

ModuleNotFoundError: No module named 'gensim.sklearn_api' on import #236

@clstaudt

Description

@clstaudt
import texthero
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
[/Users/cls/Documents/Work/Projects/Beiersdorf/SubProjects/CognitiveSearch/TopicLabelling/cognitive-search-topic-labelling/notebooks/dev-bertopic-tutorial.ipynb](https://file+.vscode-resource.vscode-cdn.net/Users/cls/Documents/Work/Projects/Beiersdorf/SubProjects/CognitiveSearch/TopicLabelling/cognitive-search-topic-labelling/notebooks/dev-bertopic-tutorial.ipynb) Cell 12 line 1
----> [1](vscode-notebook-cell:/Users/cls/Documents/Work/Projects/Beiersdorf/SubProjects/CognitiveSearch/TopicLabelling/cognitive-search-topic-labelling/notebooks/dev-bertopic-tutorial.ipynb#Y100sZmlsZQ%3D%3D?line=0) import texthero

File [~/miniforge3/envs/bdf-cognitive-search-gpu/lib/python3.10/site-packages/texthero/__init__.py:6](https://file+.vscode-resource.vscode-cdn.net/Users/cls/Documents/Work/Projects/Beiersdorf/SubProjects/CognitiveSearch/TopicLabelling/cognitive-search-topic-labelling/notebooks/~/miniforge3/envs/bdf-cognitive-search-gpu/lib/python3.10/site-packages/texthero/__init__.py:6)
      1 """Texthero: python toolkit for text preprocessing, representation and visualization.
      2 
      3 
      4 
      5 """
----> 6 from . import preprocessing
      7 from .preprocessing import *
      9 from . import representation

File [~/miniforge3/envs/bdf-cognitive-search-gpu/lib/python3.10/site-packages/texthero/preprocessing.py:24](https://file+.vscode-resource.vscode-cdn.net/Users/cls/Documents/Work/Projects/Beiersdorf/SubProjects/CognitiveSearch/TopicLabelling/cognitive-search-topic-labelling/notebooks/~/miniforge3/envs/bdf-cognitive-search-gpu/lib/python3.10/site-packages/texthero/preprocessing.py:24)
     20 import warnings
     22 warnings.filterwarnings(action="ignore", category=UserWarning, module="gensim")
---> 24 from gensim.sklearn_api.phrases import PhrasesTransformer
     27 def fillna(input: pd.Series) -> pd.Series:
     28     """Replace not assigned values with empty spaces."""

ModuleNotFoundError: No module named 'gensim.sklearn_api'
➤ pip show gensim
Name: gensim
Version: 4.3.2
Summary: Python framework for fast Vector Space Modelling
Home-page: https://radimrehurek.com/gensim/
Author: Radim Rehurek
Author-email: me@radimrehurek.com
License: LGPL-2.1-only
Location: /Users/cls/miniforge3/envs/bdf-cognitive-search-gpu/lib/python3.10/site-packages
Requires: numpy, scipy, smart-open
Required-by: bpemb, flair, texthero, top2vec

texthero installed with:

pip install --upgrade texthero --only-binary=gensim

(compiling gensim failed, therefore only binary)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions