-
-
Save broqdev/72342b22ff8ae2f250730c9244aa2484 to your computer and use it in GitHub Desktop.
Revisions
-
broqdev revised this gist
Apr 9, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -56,7 +56,7 @@ If there is some permission problem during "python setup.py", don't use "sudo" b Run python and try to import cx_Oracle import cx_Oracle con = cx_Oracle.connect ('username/password@hostname:port/sid') print(con.version) con.close() -
broqdev revised this gist
Apr 9, 2016 . 1 changed file with 9 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -48,16 +48,22 @@ Install If there is some permission problem during "python setup.py", don't use "sudo" but try to use "chown" to get permission. ## Fix cx_Oracle.DatabaseError: ORA-21561: OID generation failed echo "127.0.0.1 $(hostname)" | sudo tee -a /etc/hosts ## Test Run python and try to import cx_Oracle import cx_Oracle con = cx_Oracle.connect ('username/password@hostname:port/dbname') print(con.version) con.close() You may get some UserWarning but that's fine. If there is some error then something is wrong. ## Refrences * https://gist.github.com/thom-nic/6011715 * https://gist.github.com/kubo/8a45c653d06040c30135 * https://sourceforge.net/p/cx-oracle/mailman/message/34534872/ * https://github.com/joeferner/node-oracle/issues/47#issuecomment-38309484 -
broqdev revised this gist
Apr 8, 2016 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -52,8 +52,10 @@ If there is some permission problem during "python setup.py", don't use "sudo" b Run python and try to import cx_Oracle python >>> import cx_Oracle You may get some UserWarning but that's fine. If there is some error then something is wrong. ## Refrences * https://gist.github.com/thom-nic/6011715 * https://gist.github.com/kubo/8a45c653d06040c30135 -
broqdev revised this gist
Apr 8, 2016 . 1 changed file with 8 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,18 +13,11 @@ Download the following files from [Oracle](http://www.oracle.com/technetwork/top * instantclient-basic-macos.x64-11.2.0.4.0.zip * instantclient-sdk-macos.x64-11.2.0.4.0.zip Install export ORACLE_HOME=/usr/lib/share/oracle mkdir -p $ORACLE_HOME cd $ORACLE_HOME tar -xzf instantclient-basic-macos.x64-11.2.0.4.0.zip tar -xzf instantclient-sdk-macos.x64-11.2.0.4.0.zip @@ -35,8 +28,13 @@ Unpack both files to that directory: curl -O https://raw.githubusercontent.com/kubo/fix_oralib_osx/master/fix_oralib.rb ruby fix_oralib.rb --absolute-path ## Install cx_Oracle Download source code of cx_Oracle (https://sourceforge.net/projects/cx-oracle/files/5.1.2/) * cx_Oracle-5.1.2.tar.gz Install export DYLD_LIBRARY_PATH=$ORACLE_HOME export LD_LIBRARY_PATH=$ORACLE_HOME export OCI_LIB_DIR=$ORACLE_HOME -
broqdev revised this gist
Apr 8, 2016 . 1 changed file with 7 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -54,4 +54,10 @@ If there is some permission problem during "python setup.py", don't use "sudo" b Run python and try to import cx_Oracle python >>import cx_Oracle ## Refrences * https://gist.github.com/thom-nic/6011715 * https://gist.github.com/kubo/8a45c653d06040c30135 * https://sourceforge.net/p/cx-oracle/mailman/message/34534872/
-
broqdev revised this gist
Apr 8, 2016 . 1 changed file with 33 additions and 47 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,71 +1,57 @@ # Installing cx_Oracle (x86_64) for Mac OSX (tested on El Capitan 10.11.4) Assume you've got [homebrew](http://mxcl.github.com/homebrew/) installed. Assume python is installed through brew install python --universial ## Install instant client Download the following files from [Oracle](http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html) * instantclient-basic-macos.x64-11.2.0.4.0.zip * instantclient-sdk-macos.x64-11.2.0.4.0.zip Download source code of cx_Oracle (https://sourceforge.net/projects/cx-oracle/files/5.1.2/) * cx_Oracle-5.1.2.tar.gz Create a directory `/usr/lib/share/oracle` export ORACLE_HOME=/usr/lib/share/oracle mkdir -p $ORACLE_HOME Unpack both files to that directory: cd $ORACLE_HOME tar -xzf instantclient-basic-macos.x64-11.2.0.4.0.zip tar -xzf instantclient-sdk-macos.x64-11.2.0.4.0.zip ln -s libclntsh.dylib.11.1 libclntsh.dylib ln -s libocci.dylib.11.1 libocci.dylib curl -O https://raw.githubusercontent.com/kubo/fix_oralib_osx/master/fix_oralib.rb ruby fix_oralib.rb --absolute-path ## Build and install cx_Oracle export DYLD_LIBRARY_PATH=$ORACLE_HOME export LD_LIBRARY_PATH=$ORACLE_HOME export OCI_LIB_DIR=$ORACLE_HOME export OCI_INC_DIR=$ORACLE_HOME/sdk/include mkdir ~/cx cd ~/cx tar -xzf cx_Oracle-5.1.2.tar.gz python setup.py build install If there is some permission problem during "python setup.py", don't use "sudo" but try to use "chown" to get permission. ## Test Run python and try to import cx_Oracle python >>import cx_Oracle -
thom-nic created this gist
Jul 16, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,71 @@ # Installing cx_Oracle for Python/ Mac OSX Portions taken from http://www.cs.utexas.edu/~mitra/csSpring2011/cs327/cx_mac.html (in case that link ever dies.) Assume you've got [homebrew](http://mxcl.github.com/homebrew/) installed. Download the following files from [Oracle](http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html) * [instantclient-basic-$VERSION-macosx-x64.zip](http://download.oracle.com/otn/mac/instantclient/11203/instantclient-basic-macos.x64-11.2.0.3.0.zip) * [instantclient-sdk-$VERSION-macosx-x64.zip](http://download.oracle.com/otn/mac/instantclient/11203/instantclient-basiclite-macos.x64-11.2.0.3.0.zip) Create a directory `/usr/lib/share/oracle` export ORACLE_HOME=/usr/lib/share/oracle export VERSION=11.2.0.3.0 export ARCH=x86_64 mkdir -p $ORACLE_HOME Unpack both files to that directory: cd $ORACLE_HOME tar -xzf instantclient-basic-$VERSION-macosx-x64.zip tar -xzf instantclient-sdk-$VERSION-macosx-x64.zip ln -s libclntsh.dylib.11.2 libclntsh.dylib ln -s libocci.dylib.11.2 libocci.dylib export DYLD_LIBRARY_PATH=$ORACLE_HOME export LD_LIBRARY_PATH=$ORACLE_HOME (Note I did not have to do anything with `ottclasses.zip` as suggested in the original utexas instructions.) ## If you're using Pip: Last step is to simply run `pip`, you might have to add an arch flag: env ARCHFLAGS="-arch $ARCH" pip install cx_Oracle ## If you're building from source: Download cx_Oracle-version.tar.gz [from Sourceforge](http://cx-oracle.sourceforge.net/) export CX_ORA_VERSION=5.1.2 tar -xzf cx_Oracle-$CX_ORA_VERSION.tar.gz cd cx_Oracle-$CX_ORA_VERSION env ARCHFLAGS="-arch $ARCH" python setup.py build sudo python setup.py install ## Notes Some folks have recommended compiling for 32-bit (i386) instead, although I'm not sure why. 64 bit seems to work for me so YMMV. Basically: # compile cx_Oracle for 32-bit (requires downloading 32-bit instantclient sources) ARCHFLAGS="-arch i386" pip install cx_Oracle # then make your virtualenv python 32-bit only: virtualenv . mv bin/python python.fat lipo python.fat -remove x86_64 -output bin/python See: http://stackoverflow.com/questions/8169946/cant-get-cx-oracle-to-work-with-python-version-2-7-mac-os-10-7-2-lion-mis/8452731#8452731