Skip to content

Commit

Permalink
no longer check for cx_Oracle install
Browse files Browse the repository at this point in the history
  • Loading branch information
sillitoe committed Jan 24, 2024
1 parent 42db84c commit a6f7c7a
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions cath_alphaflow/__init__.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import cx_Oracle
import sys
import os
# import cx_Oracle
# import sys
# import os

DEFAULT_INSTANTCLIENT_VERSION = "instantclient_19_8"
# DEFAULT_INSTANTCLIENT_VERSION = "instantclient_19_8"

try:
if sys.platform.startswith("darwin"):
lib_dir_guess = os.path.join(
os.environ.get("HOME"), "Downloads", DEFAULT_INSTANTCLIENT_VERSION
)
lib_dir = os.environ.get("LD_LIBRARY_PATH", lib_dir_guess)
cx_Oracle.init_oracle_client(lib_dir=lib_dir)
elif sys.platform.startswith("win32"):
lib_dir = f"C:\\oracle\\{DEFAULT_INSTANTCLIENT_VERSION}"
cx_Oracle.init_oracle_client(lib_dir=lib_dir)
except Exception as err:
print("Failed to find instantclient: bugging out as cx_Oracle will fail ...")
print(err)
sys.exit(1)
# try:
# if sys.platform.startswith("darwin"):
# lib_dir_guess = os.path.join(
# os.environ.get("HOME"), "Downloads", DEFAULT_INSTANTCLIENT_VERSION
# )
# lib_dir = os.environ.get("LD_LIBRARY_PATH", lib_dir_guess)
# cx_Oracle.init_oracle_client(lib_dir=lib_dir)
# elif sys.platform.startswith("win32"):
# lib_dir = f"C:\\oracle\\{DEFAULT_INSTANTCLIENT_VERSION}"
# cx_Oracle.init_oracle_client(lib_dir=lib_dir)
# except Exception as err:
# print("Failed to find instantclient: bugging out as cx_Oracle will fail ...")
# print(err)
# sys.exit(1)

0 comments on commit a6f7c7a

Please sign in to comment.