1

I have suddenly got a problem that I can no longer import cx_Oracle in python. I know that a lot of people have had a similar error message as mine, which is: The specified PROCEDURE could not be found. I was wondering if there are any ways to trouble shoot this problem.

I'm running

- instantclient_12_1 
- python 3.4 64 bit
- cx_Oracle-5.2.1-12c.win-amd64-py3.4.exe

I have set the path and ORACLE_HOME environment variables to mmy instaclint 12_1 folder.

What else could be the problem? The dependency walker shows the following:

enter image description here

Does this mean that it doesn't find OCI.DLL? This file is definitely in the instaclient_12_1 folder which is listed in both ORACLE_HOME and PATH environment variable.

Nickpick
  • 6,163
  • 16
  • 65
  • 116
  • I'm not a Windows guy, but let's start with the basic: what did you change (if anything)? – tadamhicks Apr 25 '16 at 22:29
  • It was ok my work computer so not sure what has changed. But it used to work a few weeks ago. I tried to uninstall and reinstall but the problem persists. – Nickpick Apr 25 '16 at 22:30
  • What error do you get when you try to import cx_Oracle at the REPL? – tadamhicks Apr 25 '16 at 22:32
  • Error importing dll: The specified procedure could not be found. – Nickpick Apr 25 '16 at 22:33
  • I'm going to go out on a limb and suggest you try setting the DYLD and LD Library Paths as well. On a unix box I would: export ORACLE_HOME=/Library/Oracle/instantclient_11_2 export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$ORACLE_HOME export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME – tadamhicks Apr 25 '16 at 22:39
  • It's a Windows machine... How can I get the DYLD and LD paths? – Nickpick Apr 25 '16 at 22:41
  • I'm not Windows savvy, but a co-worker who is also suggested you try going to system properties and append the Oracle home to the 'path' variable under 'System variables'. It seems that setting the PATH at the cmd prompt might not handle it. – tadamhicks Apr 25 '16 at 22:43
  • In response to your DYLD and LD question, I suppose you just use Windows syntax for setting path variables...something like: set DYLD_LIBRARY_PATH=%DYLD_LIBRARY_PATH%:%ORACLE_HOME% – tadamhicks Apr 25 '16 at 22:45
  • I have set the path variable under environment variables already. It is set to the instaclient folder as described in the question. That's why I'm surprised that it's not finding oci.dll – Nickpick Apr 25 '16 at 22:45
  • Are you 100% sure the instantclient is still installed? Are permissions correct on everything there? Are you using VDI and your desktop guys dropped the instantclient from your image? – tadamhicks Apr 25 '16 at 22:48
  • I put it in C:\...Anaconda3\Lib\site-packages\instantclient_12_1 and the path variable is directed to it. 100% sure – Nickpick Apr 25 '16 at 22:55
  • I did manage to get it to work again in copying all files directly to the site-packages folder. Very odd, not sure why the path environment variable doesn't seem to work properly – Nickpick Apr 25 '16 at 23:03

1 Answers1

0

Please install according to Instant Client 12.1 requirement from https://www.oracle.com/de/database/technologies/instant-client/winx64-64-downloads.html

the required Visual Studio VS 2010 redistributable libraries for VS2010 SP1 and C++

https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads

and bounce machine

devnull
  • 570
  • 2
  • 7