[Solved]: ModuleNotFoundError: No module named 'elasticsearch'

Solution:

$ sudo pip install elasticsearch

Stack Trace
Stack Trace

$ sudo pip install elasticsearch

Password:

The directory '/Users/admin/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

The directory '/Users/admin/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

Collecting elasticsearch

  Downloading https://files.pythonhosted.org/packages/b1/f1/89735ebb863767516d55cee2cfdd5e2883ff1db903be3ba1fe15a1725adc/elasticsearch-6.3.1-py2.py3-none-any.whl (119kB)

    100% |████████████████████████████████| 122kB 2.9MB/s

Requirement already satisfied: urllib3>=1.21.1 in /Users/admin/anaconda3/lib/python3.6/site-packages (from elasticsearch) (1.24.1)

Installing collected packages: elasticsearch

Successfully installed elasticsearch-6.3.1