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):
In PyCharm, this results in the following warning:
And then, it results in the following error:
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.
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.
Please sign in to leave a comment.
How did you import elasticsearch in the first place?
Thanks