i have my Elasticsearch container running on my virtual machine en port 8081:9200 and i need to connect to it using python code when runnnig a script to create index in Elasticsearch
# Import packages
from elasticsearch import Elasticsearch
# Elastic search configuation
#es = Elasticsearch(HOST="http://localhost", PORT=8081)
#es = Elasticsearch()
es = Elasticsearch('http://localhost:9200')
# Creating index
es.indices.create(index="firstindex")
i got this error
my Elasticsearch container is runing well