I have three Python Anaconda environments which have cx\_Oracle and Oracle's Instantclient installed. I'm using `conda` to provide the virtual environments, which appears to be working fine, and I'm using Oracle Wallet to provide the actual credentials to the system. Note that these environments do not and will never have SQL\*Plus installed on them, since they're only meant to be communicating with the database through a higher abstraction (e.g. Python or Java).

The trouble I'm having is coming from two of the three environments. When performing the following Python script, connections work fine for just one of the three environments. Note that the identifier is different across environments, but is roughly the same spirit.

```
import cx_Oracle
import os
os.environ['TNS_ADMIN'] = '/data/config/wallets/app'
conn = cx_Oracle.connect('/@ENV_CONNECTION')

```

When I do this on the one environment, I get a cursor instance like I expect and everything works fine. On the other two, I see this:

```
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
cx_Oracle.DatabaseError: ORA-12162: TNS:net service name is incorrectly specified

```

I have ***quintuple checked*** the service name and the wallet itself. There is a Java application which is also using this wallet which would fail to connect if the wallet were considered bad, so I'm ruling that out on principle.

The only remaining unknown is how the wallet itself is being referenced.

How can I introspect how cx\_Oracle is referring to my TNS\_ADMIN location and pulling in the right directory? I feel like if I can figure that out, I can solve the rest.

What I have for my environment:

* conda 4.4.11
* instantclient 12.2
* cx\_Oracle version 6.3.1