python-oracledb the easy way on Linux
Submitted by dave on Mon, 09/11/2023 - 12:37
cd ~ mkdir pyenv cd pyenv python -m venv tutorial-env source tutorial-env/bin/activate pip install --upgrade pip python -m pip list python -m pip install oracledb --upgrade
You can now test this. Below test is for Thick Client since I already had an Instant Client installed and configured:
import oracledb oracledb.init_oracle_client() connection = oracledb.connect(user="scott", password="tiger", dsn="host:port/service_name") cursor = connection.cursor() for row in cursor.execute("select * from dual"): print(row)
References:
python-oracledb User Guide