[PYTHON] How to install cx_Oracle on macOS Sierra

Overview

How to install cx_Oracle, a library for connecting to Oracle from Python.

environment

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.12.3
BuildVersion:   16D32
$ python --version
Python 3.5.2 :: Anaconda 4.2.0 (x86_64)
$ pip --version
pip 9.0.1 from /Users/nobukatsu/.pyenv/versions/anaconda3-4.2.0/lib/python3.5/site-packages (python 3.5)

procedure

Instant Client Download and Deployment

http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html

From the above page

--instantclient-basic-macos.x64-[version number] .zip --instantclient-sdk-macos.x64-[version number] .zip

Download the two, unzip them, and place them in a suitable location.

Example:

/Users/nobukatsu/devel/library/oracle/instantclient_12_1

Create a symbolic link

$ pwd
/Users/nobukatsu/devel/library/oracle/instantclient_12_1
$ ln -s libclntsh.dylib.12.1 libclntsh.dylib
$ ln -s libocci.dylib.12.1 libocci.dylib

Set environment variables

Set environment variables in .bash_profile etc.

export ORACLE_HOME=~/devel/library/oracle/instantclient_12_1
export PATH=$ORACLE_HOME:$PATH
export DYLD_LIBRARY_PATH=$ORACLE_HOME
export LD_LIBRARY_PATH=$ORACLE_HOME
export FORCE_RPATH=1

cx_Oracle installation

pip install --no-cache-dir cx_oracle

Verification

If no error occurs after executing the following, the installation is successful.

python -c "import cx_Oracle"

Recommended Posts

How to install cx_Oracle on macOS Sierra
How to install graph-tool on macOS
How to install mysql-connector-python on mac
How to install VMware-Tools on Linux
How to install pycrypto on Windows
How to install OpenCV on Mac
How to install PyPy on CentOS
How to install TensorFlow on CentOS 7
How to install Maven on CentOS
How to install Go on Ubuntu
How to install music 21 on windows
Install Java2Python on macOS High Sierra (10.13)
How to install aws-session-manager-plugin on Manajro Linux
How to install drobertadams / toggl-cli on Mac
How to install Anisble on Amazon Linux 2
How to install richzhang / colorization on Windows 10
How to install Apache (httpd) on CentOS7
How to install Eclipse GlassFish 5.1.0 on CentOS 7
How to install Apache (httpd) on CentOS8
How to install NumPy on Raspberry Pi
How to install Python
How to install python
How to install Nbextensions
How to install Prover9
[2020 version] How to install Python3 on AWS EC2
How to install OpenCV on Jetson Nano Python
How to quickly install h5py on Windows 10 [Unofficial]
How to install Camunda Modeler on Manjaro Linux
[Python] How to install OpenCV on Anaconda [Windows]
How to install / verify graphviz on anaconda / windows10
[2020.8 latest] How to install Python
How to install Python [Windows]
How to quickly create a morphological analysis environment using Elasticsearch on macOS Sierra
Tabpy 1.0 (2020-01 version) How to install
How to install Linux on a 32bit UEFI PC
How to install Git GUI and Gitk on CentOS
How to install caffe on OS X with macports
How to register on pypi
How to install mkl numpy
[AWS EC2] How to install Maven on Amazon Linux 2
How to install Pelican blog
How to install git on Linux such as EC2
How to install Python2.7 python3.5 with pyenv (on RHEL5 CentOS5) (2016 Nov)
How to install Theano on Mac OS X with homebrew
Steps to install MySQL 8.0 on CentOS 8.1
How to use Dataiku on Windows
Steps to install matplotlib on Mac
Notes on how to use pywinauto
How to install python-pip with ubuntu20.04LTS
Steps to install VirtualBox on CentOS
How to install wkhtmltopdf (Amazon Linux2)
Install Scipy on Mac OS Sierra
How to deploy django-compressor on Windows
How to run matplotlib on heroku
How to install MBDyn (Linux Ubuntu)
How to use homebrew on Debian
How to install and configure blackbird
How to install and use Graphviz
How to install mysql-connector with pip3
Notes on how to use doctest
Steps to install python3 on mac