最近將Python3.6升到Python3.7,結果致使ibm_db模塊,須要從新安裝。以前,寫過在Python3.6上面安裝ibm_db模塊的文章:Mac上面安裝Python的db2數據庫驅動,發現安裝原來的方法有問題,主要就是報ssl問題,而後,就有了如今這篇文章。python
https://pypi.org/project/ibm_db/#fileslinux
https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/數據庫
cd ibm_db-2.0.9
將解壓後的文件夾clidriver
複製到 ibm_db-2.0.9
文件夾下面。macos
cd ibm_db-2.0.9 # 確保clidriver文件夾已經複製到ibm_db-2.0.9文件夾下面 zylMBP:ibm_db-2.0.9 zhangyalin$ ls -l clidriver total 8 drwxr-xr-x@ 9 zhangyalin staff 288 2 23 2017 bin drwxr-xr-x@ 8 zhangyalin staff 256 2 23 2017 bnd drwxr-xr-x@ 5 zhangyalin staff 160 2 23 2017 cfg drwxr-xr-x@ 3 zhangyalin staff 96 2 23 2017 cfgcache drwxr-xr-x@ 4 zhangyalin staff 128 2 23 2017 conv drwxr-xr-x@ 3 zhangyalin staff 96 9 3 11:22 db2dump -rwxr-xr-x@ 1 zhangyalin staff 1334 2 23 2017 db2profile drwxr-xr-x@ 11 zhangyalin staff 352 2 23 2017 include drwxr-xr-x@ 8 zhangyalin staff 256 2 23 2017 lib drwxr-xr-x@ 4 zhangyalin staff 128 2 23 2017 license drwxr-xr-x@ 3 zhangyalin staff 96 2 23 2017 msg zylMBP:ibm_db-2.0.9 zhangyalin$
python3 setup.py install
zylMBP:ibm_db-2.0.9 zhangyalin$ python3 Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 26 2018, 23:26:24) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import ibm_db; >>> import ibm_db >>> exit()
Mac上面安裝Python的db2數據庫驅動windows
odbc_cli下載地址bash