How to Install opensearch-py in Python
Python client for OpenSearch
pip install opensearch-py
What is opensearch-py?
Python client for OpenSearch
- Welcome! - User Guide - API Doc - Compatibility with OpenSearch - Project Resources - Code of Conduct - License - Copyright
opensearch-py is a community-driven, open source fork of elasticsearch-py licensed under the Apache v2.0 License. For more information, see opensearch.org and the API Doc.
To get started with the OpenSearch Python Client, see User Guide. This repository also contains working samples and benchmarks.
Quick Start
Minimal example to get started with opensearch-py:
import opensearch_py
print(opensearch_py.__version__)
Installation
pip (standard)
pip install opensearch-py
Virtual environment (recommended)
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install opensearch-py
pip3
pip3 install opensearch-py
conda
conda install -c conda-forge opensearch-py
Poetry
poetry add opensearch-py
Dependencies
Installing opensearch-py will also install these packages:
Verify the Installation
After installing, confirm the package is available:
python -c "import opensearch_py; print(opensearch_py.__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 opensearch-py with pip.
ModuleNotFoundError: No module named 'opensearch_py'
Cause: The package is not installed in the current Python environment.
Fix: Run pip install opensearch-py. If using a virtual environment, ensure it is activated first.
ModuleNotFoundError: No module named 'opensearch_py' (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 opensearch-py to install into the interpreter you are running.
ImportError: cannot import name 'X' from 'opensearch_py'
Cause: The function or class does not exist in the installed version.
Fix: Check the version with pip show opensearch-py and upgrade with pip install --upgrade opensearch-py.
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 opensearch-py. 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 opensearch-py
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 opensearch-py
Recent Releases
| Version | Released |
|---|---|
3.1.0 latest |
2025-11-20 |
3.0.0 |
2025-06-17 |
2.8.0 |
2024-11-29 |
2.7.1 |
2024-08-22 |
2.7.0 |
2024-08-20 |
Manage opensearch-py
Upgrade to latest version
pip install --upgrade opensearch-py
Install a specific version
pip install opensearch-py==3.1.0
Uninstall
pip uninstall opensearch-py
Check what is installed
pip show opensearch-py