while trying to connect Pycharm installed locally to oracle database running in container through cx_oracle an error message saying "DPI-1047: Cannot locate a 64-bit Oracle Client library" is displayed. How to fix this?
SQL Developer installed in my local machine can access the database in docker. but Pycharm is unable to connect to it. Why is that ?
The error message is clear and includes a link with instructions to follow. Install the Oracle Client libraries, e.g. Oracle Instant Client, on the machine you are running Pycharm on.
The cx_Oracle installation instructions are here: https://cx-oracle.readthedocs.io/en/latest/user_guide/installation.html. The link in the DPI-1047 will give you the same steps.
The architecture is shown in https://cx-oracle.readthedocs.io/en/latest/user_guide/introduction.html#architecture
Download and extract a 64-bit Instant Client from https://www.oracle.com/database/technologies/instant-client/downloads.html
Then set your system library search path (e.g PATH on Windows, or LD_LIBRARY_PATH on Linux) to include that directory. Then restart the application.
The fact that the DB is running in a container is not relevant. Oracle client libraries will communicate with local or remote databases. The DB version doesn't have to be the same as the version of the Oracle client libraries.