oracledba.help
SpecialTopics

Python Baseline Install

Version3.13 (latest) is not fully supported yet.
3.10 continues to be the standard.
cmd>Command Prompt Window (as Administrator)
>>>Python Prompt Window

Core Installation Steps

Install Python 3.10.nn

  • Go to download page.
  • Ctrl-F: Recommended
  • Download: Windows installer (64-bit) ... Recommended
  • Run: python-3.10.11-amd64.exe
    • Select: Install Now

Add to System PATH

  1. Run: env
  2. Select: Edit the system environment variables
Add: C:\Users\Administrator\AppData\Local\Programs\Python\Python310\
Add: C:\Users\Administrator\AppData\Local\Programs\Python\Python310\Scripts\

QC Checks

 cmd> python -m ensurepip 
Requirement already satisfied: ... cmd> python -m pip --version
pip 23.0.1 from C:\Users\...\Python310\lib\site-packages\pip (python 3.10)

Install Packages Example

 cmd> python -m pip install mido pretty_midi music21 numpy python-rtmidi

Oracle Required Installation Items

Download Oracle Instant Client (19c)
Go to the official download page here.

Download and Unzip

  • instantclient-basic-windows.x64-19.19.zip
  • instantclient-sdk-windows.x64-19.19.zip (optional, mostly for compiling)
  • Unzip both to the same folder, e.g.: C:\oracle\instantclient_19_19

Add to System PATH

  1. Run: env
  2. Select: Edit the system environment variables
Add: C:\oracle\instantclient_19_19

Install oracledb Package

 cmd> py
 >>> pip install oracledb

oracledb Example

import oracledb
oracledb.init_oracle_client(lib_dir=r"C:\oracle\instantclient_19_19")
conn = oracledb.connect(user="your_user", password="your_pw", dsn="your_dsn")
print(conn.version)


If Required (Legacy): Install cx_Oracle Package

 cmd> py
 >>> pip install cx_Oracle

cx_Oracle Example

import cx_Oracle
cx_Oracle.init_oracle_client(lib_dir=r"C:\oracle\instantclient_19_19")
conn = cx_Oracle.connect("user/password@dsn")
print(conn.version)