6

Trying to use elastic search for a project.

from elasticsearch import Elasticsearch
es = Elasticsearch(
    "https://example.com",
    http_auth=("abc", "bcd"),
)

But getting the error:

ValueError: URL must include a 'scheme', 'host', and 'port' component (ie 'https://localhost:9200')

I am running this on Pycharm CE and have created a Virtual Environment of Python 3.9 . Should I be using a different version of Python to make this work?? Moreover, I have already tried pip install acryl-datahub[datahub-rest,elasticsearch]==0.8.27.1 but to no avail.

Ansh Gupta
  • 81
  • 3
  • 7

1 Answers1

6

I was facing the same error. Installing ES version 7.17 solved the problem. I was also getting a not available on pip install acryl-datahub[datahub-rest,elasticsearch]==0.8.27.1. Tried with the next one available (0.8.28.0) and realized it was downgrading elasticsearch to 7.17.

So try pip install elasticsearch==7.17.