Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Unable to import AsyncOpenSearch from opensearch-py v2.2.0 #332

Closed
elamirKad opened this issue Mar 18, 2023 · 3 comments · Fixed by #338 or #340
Closed

[BUG] Unable to import AsyncOpenSearch from opensearch-py v2.2.0 #332

elamirKad opened this issue Mar 18, 2023 · 3 comments · Fixed by #338 or #340
Labels
bug Something isn't working untriaged Need triage

Comments

@elamirKad
Copy link

What is the bug?

I tried to replicate the code from this issue #172 and encountered a problem when trying to import AsyncOpenSearch.
ImportError: cannot import name 'AsyncOpenSearch' from 'opensearchpy' (C:\Users\elami\.virtualenvs\testing-opensearch\lib\site-packages\opensearchpy\__init__.py)

How can one reproduce the bug?

  1. Install the opensearch-py library using pip install opensearch-py or pip install --upgrade opensearch-py.
  2. Try to import the AsyncOpenSearch class using the following import statement:
    from opensearchpy import AsyncOpenSearch

What is the expected behavior?

The AsyncOpenSearch class should be imported successfully without any issues.

What is your host/environment?

Tested both on Windows 11 and Ubuntu 22.04

Do you have any screenshots?

Not applicable.

Do you have any additional context?

I have the following opensearch-py library version installed:

Name: opensearch-py
Version: 2.2.0
Summary: Python client for OpenSearch
Home-page: https://github.com/opensearch-project/opensearch-py
Author: Aleksei Atavin, Denis Zalevskiy, Rushi Agrawal, Shephali Mittal
Author-email: axeo@aiven.io, dez@aiven.io, rushi.agr@gmail.com, shephalm@amazon.com
License: Apache-2.0
Location: c:\users\elami.virtualenvs\testing-opensearch\lib\site-packages
Requires: certifi, python-dateutil, requests, six, urllib3
Required-by:

Python version on Ubuntu: 3.8.10
Python version on Windows: 3.10.7

Despite installing and upgrading the library, the import issue persists.

@elamirKad elamirKad added bug Something isn't working untriaged Need triage labels Mar 18, 2023
@margulanz
Copy link

pip install aiohttp, then try import again. Let me know if it works.

@elamirKad
Copy link
Author

@margulanz thanks! It worked like a charm.

@dblock
Copy link
Member

dblock commented Mar 20, 2023

Do we have a bug/problem in opensearch-py?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working untriaged Need triage
Projects
None yet
3 participants