Import problems with PyCharm [+Import resolves to its containing file][+Elasticsearch]

This import should work (and it actually works out of PyCharm, like in IDLE for example, or python command line):

from elasticsearch import Elasticsearch

In PyCharm, this results in the following warning:

Import resolves to its containing file... (Ctrl+F1) 
This inspection detects names that should resolve but don't. Due to dynamic dispatch and duck typing, this is possible in a limited but useful number of cases. Top-level and class-level items are supported better than instance items.  

And then, it results in the following error:

File "C:/Users/luiz/Dropbox/GitHub/actornetwork/tests\", line 3, in <module>
    from elasticsearch import Elasticsearch
ImportError: cannot import name Elasticsearch

Anyone know what is happening?

EDIT: PROBLEM SOLVED, my python file name was "", i needed to rename it to avoid import conflicts.
1 comment
Comment actions Permalink
How did you import elasticsearch in the first place?

Please sign in to leave a comment.