I am working on oracle cloud machine where python-flask application is deployed in docker container.  

I am trying to initiate a connection from the application to Oracle Autonomous Database.  

This connection is established by python ORM SQLAlchemy

The connection to mysql was established without any problem with details as given below.

```
engine = create_engine(
                'mysql+mysqlconnector://username:password@host:3306/databasename')
            cls.session_factory = sessionmaker(bind=engine)
            cls.base = declarative_base(bind=engine)

```

But when I am trying to connect to oracle database using cx\_oracle driver its throwing an error.

```
engine = create_engine(
                'oracle+cx_oracle://username:password@host:1522/databasename')
            cls.session_factory = sessionmaker(bind=engine)
            cls.base = declarative_base(bind=engine)

```

The error thrown is :

```
sqlalchemy.exc.DatabaseError: (cx_Oracle.DatabaseError) DPI-1047: Cannot locate a 64-bit Oracle Client library: "libclntsh.so: cannot open shared object file: No such file or directory". See https://oracle.github.io/odpi/doc/installation.html#linux for help

```

From the above error I understood that I need to provide some oracle client library which i then downloaded and installed.

```
RUN apt-get update && apt-get install unzip
RUN wget https://download.oracle.com/otn_software/linux/instantclient/193000/instantclient-basiclite-linux.x64-19.3.0.0.0dbru.zip
RUN unzip instantclient-basiclite-linux.x64-19.3.0.0.0dbru.zip
RUN apt-get update && apt-get install libaio1
RUN ldconfig

```

But issue still exists.  

Has anyone tried to create a connection to Oracle Autonomous Database from a python application even if its not from docker container or even without sql-alchemy

**UPDATE**

Still facing this issue. I am pasting the exact dockerfile below for reference.

```

FROM python:3.6-buster
RUN echo 'setting workdir'
WORKDIR /app

RUN echo 'running docker, install dependencies of docker file '
ADD requirements.txt /app/requirements.txt
RUN echo 'now installing from req.txt if any left'
RUN pip install -r /app/requirements.txt
RUN echo 'copying everything to app'
COPY . /app

RUN mkdir opt && cd opt && \
    wget https://download.oracle.com/otn_software/linux/instantclient/193000/instantclient-basiclite-linux.x64-19.3.0.0.0dbru.zip && \
    unzip instantclient-basiclite-linux.x64-19.3.0.0.0dbru.zip && \
    echo /instantclient_19_3 > /etc/ld.so.conf.d/oracle-instantclient.conf && \
    cd instantclient_19_3 && ls -lrt && ldconfig

ENV TNS_ADMIN=/app/keys
RUN ls -lrt
RUN echo 'port exposed'
EXPOSE 5060
CMD ["gunicorn", "-b", "0.0.0.0:5060", "-t","120", "wsgi"]

```

**ERROR MESSAGE:**

```
cx_Oracle.DatabaseError: DPI-1047: Cannot locate a 64-bit Oracle Client library: "libclntsh.so: cannot open shared object file: No such file or directory". See https://oracle.github.io/odpi/doc/installation.html#linux for help

```