rhsimplex / image-match

🎇 Quickly search over billions of images
2.94k stars 405 forks source link

I'm getting elasticsearch.exceptions.ConnectionError #43

Closed jtara1 closed 8 years ago

jtara1 commented 8 years ago

OS: Ubuntu 16.04 Python 3.5.2


I'm just trying to get the basic example working from the Documentation.

I installed using sudo pip3 install . while in the image-match directory. Here's the code I'm running in test.py:

from elasticsearch import Elasticsearch
from image_match.elasticsearch_driver import SignatureES

es = Elasticsearch()
ses = SignatureES(es)

ses.add_image('http://i.imgur.com/KUuRtTc.jpg')

The exception / error I'm getting is a chain of exceptions with the most recent one being

elasticsearch.exceptions.ConnectionError:
ConnectionError(<urllib3.connection.HTTPConnection object at 0x7fb8425c27b8>: 
Failed to establish a new connection: 
[Errno 111] Coonnection.HTTPConnection object at 0x7fb8425c27b8>: 
Failed to establish a new connection: [Errno 111] Connection refused)

Full traceback

jtara1 commented 8 years ago

Solved this by uninstalling elasticsearch (v1.7.x) and installing elasticsearch (v2.4.0). I initially installed it via sudo apt-get install elasticsearch which chose v1.7.x for me.

I downloaded the newer version here.

Also when I go localhost:9200/images/image I'm getting a valid http response now.

rhsimplex commented 8 years ago

Yeah, canonical's repositories usually have pretty outdated builds. Glad everything is working for you!