I'm using anaconda with Python3
I installed cx_oracle package using pip.
When I type import cx_Oracle
or run the code, the python interpreter recognizes the package and runs it, but for some reason the PyChram doesn't recognize the package and doesn't suggest me autocomplete.
As you see in the screenshot, the package name is cx-Oracle
instead of cx_Oracle
, so I looked for cx-Oracle
in the anaconda folder (and sub folders) and changed it to cx_Oracle
, but without success.
Do not rename the folders! It doesn't matter that the distributed package has a dash in its name -- its developers have probably taken care of it and it is installed under Python package with underscores instead.
In your terminal, check the output of "pip freeze". Is the package listed there?
If not, run "which python". If it's not the same as you have in the project interpreters dialog, that's the problem. You should activate the right virtual environment first.
Also, sometimes PyCharm fails to update indices. A restart or resetting interpeter may help.