2017년 5월 3일 수요일

[Python] Oracle Client Install & cx_Oracle Install on Mac


1. Download Instant Client - Oracle Web Site :

instantclient-basic-macos.x64-11.2.0.4.0.zip
instantclient-sdk-macos.x64-11.2.0.4.0.zip
instantclient-sqlplus-macos.x64-11.2.0.4.0.zip

Unzip and move to /Library/Oracle

1.1 .bash_profile Files Modify
export DYLD_LIBRARY_PATH="/Library/Oracle/instantclient_11_2"
export TNS_ADMIN="/Library/Oracle/instantclient_11_2"
export ORACLE_HOME="/Library/Oracle/instantclient_11_2"
export OCI_LIB="/Library/Oracle/instantclient_11_2"
export OCI_INCLUDE_DIR="/Library/Oracle/instantclient_11_2/sdk/include"

export PATH=$DYLD_LIBRARY_PATH:$PATH

2. Create symlink

 $ cd /Library/Oracle/instantclient_11_2/
 $ ln -s libclntsh.dylib.11.1 libclntsh.dylib

[ This step might not be needed ]

3. Copy files:

 sudo cp /Library/Oracle/instantclient_11_2/sdk/include/*.h /usr/include/
 sudo cp /Library/Oracle/instantclient_11_2/*.dylib /usr/lib
 sudo cp /Library/Oracle/instantclient_11_2/sqlplus /usr/bin

If it needs root permission, sudo to root first.

Make sure you do this rather than sudo because you need to set the environment variable in the correct shell

if Mac OS - Operation not Permitted
Refenece - http://macnews.tistory.com/3408


4. Run pip install cx_Oracle

Installl Complete

댓글 없음:

댓글 쓰기

 다양한 채널의  블로그 작성으로  집중이 좀 안되기도 하고  나의 회사를 운영하고 관리 하다 보니  회사의 블로그로 작성 해보는 것은 어떤가 하고  하나로 옮겨 봅니다.  (주)다이닝웨이브 - 블로그 바로가기