[Python] With python-oracledb what does 'DPY-4027: no configuration directory to search for...

Discussão em 'Python' iniciado por Stack, Março 3, 2025.

  1. Stack

    Stack Membro Participativo


    1. With the python-oracledb driver the code:

      import oracledb

      cs = "MYDB"
      c = oracledb.connect(user='cj', password=mypw, dsn=cs)


      gives the error:

      oracledb.exceptions.DatabaseError: DPY-4027: no configuration directory to search for tnsnames.ora

    2. The same error also occurs in a second case:

      import oracledb

      cs = "MYDB = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orclpdb1)))"
      c = oracledb.connect(user='cj', password=mypw, dsn=cs)


      and with this:

      import oracledb

      cs = "MYDB = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orclpdb1)))"

      cp = oracledb.ConnectParams()
      cp.parse_connect_string(cs)

    What does this mean?

    Continue reading...

Compartilhe esta Página