How to Install seaborn in Python
Statistical data visualization
pip install seaborn
What is seaborn?
Statistical data visualization
Seaborn is a Python visualization library based on matplotlib. It provides a high-level interface for drawing attractive statistical graphics.
Online documentation is available at seaborn.pydata.org.
The docs include a tutorial, example gallery, API reference, FAQ, and other useful information.
Quick Start
Minimal example to get started with seaborn:
import seaborn
print(seaborn.__version__)
Installation
pip (standard)
pip install seaborn
Virtual environment (recommended)
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install seaborn
pip3
pip3 install seaborn
conda
conda install -c conda-forge seaborn
Poetry
poetry add seaborn
Dependencies
Installing seaborn will also install these packages:
Verify the Installation
After installing, confirm the package is available:
python -c "import seaborn; print(seaborn.__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 seaborn with pip.
ModuleNotFoundError: No module named 'seaborn'
Cause: The package is not installed in the current Python environment.
Fix: Run pip install seaborn. If using a virtual environment, ensure it is activated first.
ModuleNotFoundError: No module named 'seaborn' (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 seaborn to install into the interpreter you are running.
ImportError: cannot import name 'X' from 'seaborn'
Cause: The function or class does not exist in the installed version.
Fix: Check the version with pip show seaborn and upgrade with pip install --upgrade seaborn.
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 seaborn. 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 seaborn
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 seaborn
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
| Version | Released |
|---|---|
0.13.2 latest |
2024-01-25 |
0.13.1 |
2023-12-31 |
0.13.0 |
2023-09-29 |
0.13.0rc0 |
2023-09-26 |
0.12.2 |
2022-12-30 |
Manage seaborn
Upgrade to latest version
pip install --upgrade seaborn
Install a specific version
pip install seaborn==0.13.2
Uninstall
pip uninstall seaborn
Check what is installed
pip show seaborn