diff --git a/IBM_DB/ibm_db/setup.py b/IBM_DB/ibm_db/setup.py index e43df5ad..3c11efdc 100644 --- a/IBM_DB/ibm_db/setup.py +++ b/IBM_DB/ibm_db/setup.py @@ -235,7 +235,10 @@ def _setDllPath(): ibm_db_lib = os.path.join(ibm_db_dir, 'lib') if not os.path.isdir('clidriver'): - url = 'https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/' + cliFileName + if 'IBM_DB_INSTALLER_URL' in os.environ: + url = os.getenv('IBM_DB_INSTALLER_URL') + cliFileName + else: + url = 'https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/' + cliFileName sys.stdout.write("Downloading %s\n" % (url)) sys.stdout.flush(); file_stream = BytesIO(request.urlopen(url, context=context).read()) diff --git a/README.md b/README.md index 4d143a38..16eed92a 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,11 @@ pip install ibm_db ``` This will install ibm_db and ibm_db_dbi module. +If you have to use your own URL for clidriver please set environment variable +``` +IBM_DB_INSTALLER_URL +``` + If you are using python 3.8 or 3.9 on windows and building the source manually, you will need to set dll path of dependent library of clidriver before importing the module as: ``` import os