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):

Code
from elasticsearch import Elasticsearch


In PyCharm, this results in the following warning:

Code
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:

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


Anyone know what is happening?
Thanks,

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

Please sign in to leave a comment.