How to Install selenium in Python

v4.43.0 Testing & QA Python >=3.10 Apache-2.0

Official Python bindings for Selenium WebDriver

Install pip install selenium

What is selenium?

Official Python bindings for Selenium WebDriver

Python language bindings for Selenium WebDriver.

The package is used to automate web browser interaction from Python.

Updated documentation published with each commit is available at:

Quick Start

Minimal example to get started with selenium:

import selenium

print(selenium.__version__)

Installation

pip (standard)

pip install selenium

Virtual environment (recommended)

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

pip3

pip3 install selenium

conda

conda install -c conda-forge selenium

Poetry

poetry add selenium

Dependencies

Installing selenium will also install these packages:

Verify the Installation

After installing, confirm the package is available:

python -c "import selenium; print(selenium.__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 selenium with pip.

ModuleNotFoundError: No module named 'selenium'

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

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

ModuleNotFoundError: No module named 'selenium' (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 selenium to install into the interpreter you are running.

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

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

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

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 selenium. 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 selenium

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 selenium

Runtime Errors

Common errors when using selenium after installation.

WebDriverException: 'chromedriver' executable needs to be in PATH

Cause: ChromeDriver binary is not installed or not on PATH.

Fix: Install automatically: pip install webdriver-manager and use ChromeDriverManager().install()

NoSuchElementException

Cause: The element was not found on the page — it may not have loaded yet.

Fix: Use explicit waits: WebDriverWait(driver, 10).until(EC.presence_of_element_located(...))

StaleElementReferenceException

Cause: The DOM was updated after the element reference was captured.

Fix: Re-find the element after any page action that triggers a DOM update.

Recent Releases

VersionReleased
4.43.0 latest 2026-04-10
4.42.0 2026-04-09
4.41.0 2026-02-20
4.40.0 2026-01-18
4.39.0 2025-12-06

Full release history on PyPI →

Manage selenium

Upgrade to latest version

pip install --upgrade selenium

Install a specific version

pip install selenium==4.43.0

Uninstall

pip uninstall selenium

Check what is installed

pip show selenium

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