Oracle® Database. Client Release Notes. 11 g Release 2 (11.2) for Apple Mac OS X (Intel). This document contains important information that was not included in the platform-specific or product-specific documentation for this release. Oracle Instant Client on Mac OS X A while back I broke down to the peer pressure in the APEX community (you know who you are;-) and bought a Mac Book Air. I’m still learning the ropes and one thing that took some time to get working was the Oracle Instant Client.
- What is your version of Python? Is it 32-bit or 64-bit?
Python 2.7.10 64-bit
Mac OS X Sierra - What is your version of cx_Oracle?
6.0rc1 - What is your version of the Oracle client (e.g. Instant Client)? How was it
installed? Where is it installed?
Oracle Instant client Mac OS X 12.1
(actually I've installed it multiple times in multiple location)
I have followed the Oracle method to the letter:
http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html#ic_osx_inst
(and I tired a number of other options including putting dynlib files in /usr/local/lib with no luck) - What is your version of the Oracle Database?
N/A - What is your OS and version?
Mac OS X Sierra 10.12.5 - What compiler version did you use? For example, with GCC, run
gcc --version
.
- What environment variables did you set? How exactly did you set them?
Ok, so I tried a lot of environment variables.
I also tried setting PYTHONPATH and adding the Oracle client directory to sys.path using .pth and the site.py configuration options.
- What exact command caused the problem (e.g. what command did you try to
install with)? Who were you logged in as?python -c 'import cx_Oracle; print cx_Oracle.version'
- What error(s) you are seeing?
No matter what I tried I would get this error:
So there are lots of antidotal references to this being related to SIP (System Integrity Protection), though I could find no specific technical note from Apple that says exactly what is causing the above error (inability to find dynamic linked library at run time).
So I did find a solution that did not require disabling SIP on Mac OS X. It is pretty simple, and seems to support the theory of SPI being an issue, and matches a lot of notes about discontinuing usage of the LD and DYLD paths.
![Client Client](/uploads/1/2/6/2/126215311/570891823.png)
once it is built I then modified the rpath of the cx_Oracle.so library to include the Oracle instant client location:
install_name_tool -add_rpath ~/instantclient_12_1 ./build/lib.macosx-10.12-intel-2.7/cx_Oracle.so
https://supernalseeker183.weebly.com/blog/how-to-use-sstp-client-for-mac.I could very it was added by using the otool command:
otool -l ./build/lib.macosx-10.12-intel-2.7/cx_Oracle.so
Now that it has been modified, I can do the normal install.
sudo python setup.py install
This puts the cx_oracle egg into the normal system path
Post this modification I can now call python and use cx_Oracle on Mac OS X normally.
The biggest issues for this are:
- having Oracle client directory in a 'known' location before building cx_Oracle
- having to rebuild the cx_Oracle if you change Oracle client location (possibly due to version)
I beat my head on a wall for at least two days trying all the normal workarounds. This was the only model that worked.
Admiralty I didn't try any of this with Pip, I only did this from source code.
I also tied setting FORCE_RPATH=1 but on introspection it never updated the .so file correctly.
Admiralty I didn't try any of this with Pip, I only did this from source code.
I also tied setting FORCE_RPATH=1 but on introspection it never updated the .so file correctly.
Hope this helps some future install issues.
Thanks,
Gary
Thanks,
Gary
![For For](/uploads/1/2/6/2/126215311/853899874.png)
A while back I broke down to the peer pressure in the APEX community (you know who you are ;-) and bought a Mac Book Air. I’m still learning the ropes and one thing that took some time to get working was the Oracle Instant Client. Installing it isn’t as straightforward as installing the Instant Client on Windows.
I finally got it working and thought I’d post what I did for others that are new to OS X.
Download Instant Client
First you’ll nee to download the Instant Client for OS X. I downloaded the following files for Version 11.2.0.3.0 (64-bit):
- instantclient-basic-macos.x64-11.2.0.3.0.zip
- instantclient-sqlplus-macos.x64-11.2.0.3.0.zip
Unzip both files and put their contents in
/oracle/instantclient_11_2/
Setting Paths
You’ll need to set the appropriate paths to load by default in Terminal. Open Terminal and run:
Download Oracle 11g Client For Mac Os X
Running SQL*Plus
Now when you open a new terminal window you should be able to run SQL*Plus
Additional Addons
Oracle Mac Download
When using SQL*Plus in Windows you can use the Up arrow to get your previous command. If you do that in Linux you’ll get some weird character. The good news is that there’s a program to resolve it called
rlwrap
. CJ Travis has a good post on how to install rlwrap of Mac OS X.