On macOS with Python 3.9.6 the Python code using Oracle's python-oracledb driver:
import oracledb
import os
un = os.environ.get("PYTHON_USERNAME")
pw = os.environ.get("PYTHON_PASSWORD")
cs = "localhost/orclpdb1"
c = oracledb.connect(user=un, password=pw, dsn=cs)
gives the error:
DPY-6005: cannot connect to database. Connection failed with "[Errno 61] Connection refused"
on Linux the error is like:
DPY-6005: cannot connect to database. Connection failed with "[Errno 111] Connection refused"
What do these mean?
[Update: in python-oracledb 1.0.1 the error is wrapped with DPY-6005. In 1.0.0 just the lower level Python part of the error was shown.]