Install & Compatibility
Where this runs
tested against v1.2.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
build_error
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 15.8s · import 5.584s · 382MB
393MB installed
● package 393MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
gsea
✓ from gseapy import GSEA
✗ import gseapy as gp
enrichr
✓ from gseapy import Enrichr
✗ import gseapy as gp
prerank
✓ from gseapy import Prerank
✗ import gseapy as gp
This quickstart demonstrates how to perform an Enrichr analysis using a simple gene list. It will download specified gene set libraries (if not cached) and generate enrichment results in the specified output directory. For GSEA, expression data and class vectors are typically required.
import gseapy as gp
import os
# Example gene list for Enrichr
gene_list = ['TP53', 'MYC', 'EGFR', 'BRAF', 'KRAS', 'RB1', 'PTEN', 'PIK3CA']
# Run Enrichr analysis
enr = gp.enrichr(
gene_list=gene_list,
gene_sets=['KEGG_2021_Human', 'GO_Biological_Process_2021'], # Specify gene set libraries
organism='Human', # Default
outdir='enrichr_results_example', # Output directory
cutoff=0.5, # P-value cutoff for results
no_plot=True, # Set to False to generate plots
verbose=False
)
print(f"Enrichr results saved to: {enr.outdir}")
# Optional: Clean up the generated directory
# import shutil
# if os.path.exists('enrichr_results_example'):
# shutil.rmtree('enrichr_results_example')
gseapy --version
Debug
Known issues
breakingVersions of gseapy prior to 1.1.12 may encounter compatibility issues when used with Pandas 3.0+, leading to `AttributeError` or `TypeError` during data processing and plotting. Key fixes were implemented in v1.1.12 and v1.1.13.fixUpgrade gseapy to version 1.1.13 or newer: `pip install --upgrade gseapy`.
affects: <1.1.12
breakingA bug in gseapy v1.1.6 and v1.1.7 caused incorrect gene name order when calling `gsea()` with `permutation_type='gene_set'`, leading to potentially invalid results.fixUpdate gseapy to v1.1.8 or later and re-run any affected analyses: `pip install --upgrade gseapy`.
affects: 1.1.6, 1.1.7
deprecatedGSEApy dropped support for Python 3.7 starting with version 1.1.10. Attempting to install or run gseapy 1.1.10+ on Python 3.7 will likely lead to dependency resolution errors or runtime issues.fixUpgrade your Python environment to 3.8 or newer before installing gseapy: `conda create -n myenv python=3.9 && conda activate myenv`.
affects: >=1.1.10 (for Python 3.7 users)
gotchaResults from `gsea()` or `prerank()` might be inconsistent between different runs or environments due to a potential compilation issue, which was addressed in v1.1.9.fixEnsure you are using gseapy v1.1.9 or newer to guarantee consistent results across runs: `pip install --upgrade gseapy`.
affects: <1.1.9
gotchaGene symbol matching can be sensitive to casing. Although gseapy attempts to convert lowercase symbols to uppercase implicitly (since v1.1.5), inconsistent casing between your input data and gene set libraries can lead to genes not being found and thus ignored.fixStandardize all gene symbols to uppercase in your input data (e.g., `df.index = df.index.str.upper()`) before running GSEApy functions. Review the `no_genes` column in Enrichr results or the `data.gsea_data.genes.not_found` attribute for GSEA results.
affects: <1.1.5, all (best practice)
Upgrade
Version history
1.2.1latest on PyPI · released Apr 27, 2026
Audit
Dependencies
numpyrequiredNumerical operations and array handling.
pandasrequiredData manipulation with DataFrames, crucial for input/output and internal data structures.
scipyrequiredScientific computing, statistical tests, and clustering algorithms.
matplotlibrequiredPlotting and visualization of enrichment results.
logururequiredEnhanced logging for better debugging and user feedback.