Compiling cx_Oracle for Maya's 64 bit Python in Windows 7 64 with Visual Studio 2010. Create a folder inside your Oracle Client install called sdk.
7 Votes 2547 Views I have installed Anaconda 3.5 for Windows 64bits, and I need to connect to the Oracle database using package 'cxOracle'. I tried with the anaconda way: conda install -c cxoracle The error messages below: Hint: the following packages conflict with each other: - cxoracle - python 3.5 Use 'conda info cxoracle' etc. To see the dependencies for each package. Note that the following features are enabled: - vc14.
It seems that cxoracle isn't compatible with Python 3.5. After this, I also tried to install directly with the binary: python setup.py install It throws a bunch of errors like. CxOracle.obj: error LNK2001: unresolved external symbol OCILobGetChunkSize cxOracle.obj: error LNK2001: unresolved external symbol OCIStmtExecute cxOracle.obj: error LNK2001: unresolved external symbol OCILobFileClose. Is there a way to install cxoracle for Anaconda 3.5?? Thanks a lot for your help!
It's kind of non-trivial. However doable. Follow these steps: 1) Download Oracle Instant client for Windows x64 from e.g.
Choose client e.g. 11.2.0.4 - instantclient-basic-windows.x64-11.2.0.4.0.zip - instantclient-sdk-windows.x64-12.1.0.2.0.zip 2) Create directory and unzip the client & sdk in there: e.g. C: ora 11gx64 3) Set ORACLEHOME and TNSADMIN See for details e.g. ORACLEHOME=c: ora 11gx64 and TNSADMIN=c: ora 11gx64 also add%ORACLEHOME% in Your%PATH% 4) In the created directory put file tnsnames.ora and fill with connection string to db:%ORACLEHOME%.tnsnames.ora.
XE = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521)) (CONNECTDATA = (SERVER = DEDICATED) (SERVICENAME = XE) ) ) - replace 127.0.0.1 with your hostname - replace XE with your SID 5) I suppose You've got already Python installed. Otherwise visit Download page for Python - Install python (3.6.1 in the time of writting) - If not installed install pip - execute python get-pip.py 6) Download and Install Visual C 2015 Build Tools - Search for Visual C 2015 Build Tools - Install visualcppbuildtoolsfull.exe 7) Use pip to install cxoracle pip install cxoracle (in the time of writing there is trouble with default installed version 5.3 so the Version 6.0b2 has to be installed) python -m pip install cxOracle -pre The first steps are universal in my honest opinion for both conda and pip.
For installation issues: I went to upgrade my cxOracle version from 6.1 to 6.2 today, and instead of downloading the wheel for python 36 64 bit on Windows, it downloaded the source. After the failed installation, I was able to force installation by doing: pip install -upgrade cxOracle6.2 The correct wheel was downloaded installed successfully. I think this might happen because of the extra '-2' in the source package name on pypi. So pip believes the newest version is 6.2-2 and no wheel exists for the environment? Answer the following questions:.
What is your version of Python? Is it 32-bit or 64-bit? 64-bit.
What is your version of cxOracle? 6.1. What is your version of the Oracle client (e.g. Instant Client)?
How was it installed? Where is it installed? 12.1.
What is your OS and version? Windows Server 2012 R2. What exact command caused the problem (e.g. What command did you try to install with)? Who were you logged in as? Pip install -upgrade cxOracle.
What error(s) you are seeing? Downloads source instead of wheel file.