How to Install gensim in Python

v4.4.0 Data & Science Python >=3.9 LGPL-2.1-only

Python framework for fast Vector Space Modelling

Install pip install gensim

What is gensim?

Python framework for fast Vector Space Modelling

Gensim is a Python library for topic modelling, document indexing and similarity retrieval with large corpora. Target audience is the natural language processing (NLP) and information retrieval (IR) community.

All algorithms are memory-independent w.r.t. the corpus size (can process input larger than RAM, streamed, out-of-core) Intuitive interfaces

easy to plug in your own input corpus/datastream (simple streaming API) easy to extend with other Vector Space algorithms (simple transformation API)

Quick Start

Minimal example to get started with gensim:

import gensim

print(gensim.__version__)

Installation

pip (standard)

pip install gensim

Virtual environment (recommended)

python -m venv venv
source venv/bin/activate   # Windows: venv\Scripts\activate
pip install gensim

pip3

pip3 install gensim

conda

conda install -c conda-forge gensim

Poetry

poetry add gensim

Dependencies

Installing gensim will also install these packages:

Verify the Installation

After installing, confirm the package is available:

python -c "import gensim; print(gensim.__version__)"

If this prints a version number, installation succeeded. If you see a ModuleNotFoundError, see the errors section below.

Installation Errors

Common errors when installing gensim with pip.

ModuleNotFoundError: No module named 'gensim'

Cause: The package is not installed in the current Python environment.

Fix: Run pip install gensim. If using a virtual environment, ensure it is activated first.

ModuleNotFoundError: No module named 'gensim' (installed but still failing)

Cause: pip installed the package into a different Python than the one running your script.

Fix: Use python -m pip install gensim to install into the interpreter you are running.

ImportError: cannot import name 'X' from 'gensim'

Cause: The function or class does not exist in the installed version.

Fix: Check the version with pip show gensim and upgrade with pip install --upgrade gensim.

pip: command not found

Cause: pip is not in PATH or Python was not added to PATH during installation.

Fix: Try python -m pip install gensim. On macOS/Linux try pip3.

PermissionError: [Errno 13] Permission denied

Cause: No write access to the system Python package directory.

Fix: Use a virtual environment, or add --user: pip install --user gensim

SSL: CERTIFICATE_VERIFY_FAILED

Cause: pip cannot verify PyPI's SSL certificate — common behind corporate proxies.

Fix: Try: pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org gensim

MemoryError when loading data

Cause: Dataset is too large to fit in RAM.

Fix: Read in chunks, filter columns on load, or consider Polars/Dask for out-of-core processing.

Recent Releases

VersionReleased
4.4.0 latest 2025-10-18
4.3.3 2024-07-19
4.3.2 2023-08-24
4.3.1 2023-03-10
4.3.0 2022-12-21

Full release history on PyPI →

Manage gensim

Upgrade to latest version

pip install --upgrade gensim

Install a specific version

pip install gensim==4.4.0

Uninstall

pip uninstall gensim

Check what is installed

pip show gensim

Last updated: 2026-04-11 • Data from PyPI