Forum Stats

  • 3,770,284 Users
  • 2,253,089 Discussions
  • 7,875,387 Comments

Discussions

Windows 10, Cygwin, python 3, Oracle client... DatabaseError: DPI-1047

user4565183
user4565183 Member Posts: 3
edited Oct 31, 2019 3:42PM in Python

When I did a search for these key words: "Cygwin, Python, Oracle client", I got a suggested "Did you mean CGI?" ...so I apologize if this is a duplicate question (as I'm sure it is). If I'm in the wrong group/forum, please help me find the right place.

TL;DR: is there a current document / web page / video / article that describes how to set up on Windows 10, Cygwin with python 3 (cx_Oracle) client?

I *have* to think this has been asked before.... I'm hoping some forum regular will say, "Oh yea, you want this document"

Between the mis-information and the out-dated information and the versioning of both Cygwin/Python and Oracle, I simply cannot get this to work. Cygwin is difficult to uninstall so starting fresh is not really an option, I need to "fix" this.

Here's the breakdown:

I have Windows 10 Pro

On my desktop, I have dbeaver installed and connecting, using the ojdbc8.jar under a 'oreclient' directory.

I have Cygwin installed (it's not my choice)

$ cygcheck -V

cygcheck (cygwin) 3.0.7

System Checker for Cygwin

Copyright (C) 1998 - 2019 Cygwin Authors

This is free software; see the source for copying conditions.  There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Using the Cygwin installer, I chose/installed Python3 (3.6.8-1)...

I also have python installed on my local machine (because I develop in python, duh), but I think this might be my first problem. Cygwin doesn't find it's own version and finds the local install Python3.7

$ which python

/cygdrive/c/Python37/python

Using pip (in Cygwin), I installed the cx_Oracle package. I can import it but when I try to make a connection, I get the following error (credential details have been obfuscated).

$ python -i

Python 3.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 19:29:22) [MSC v.1916 32 bit (Intel)] on win32

Type "help", "copyright", "credits" or "license" for more information.

>>> import cx_Oracle

>>> con = cx_Oracle.connect('username/[email protected]:1523/database')

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

cx_Oracle.DatabaseError: DPI-1047: Cannot locate a 32-bit Oracle Client library: "The specified module could not be found". See https://oracle.github.io/odpi/doc/installation.html#windows for help

>>>

Yes, I did follow the link to github... the first thing it suggests is that I need Visual Studio for one library file. I can install VS (I have a license) but then I have to hand this off to Operations and they will NOT have VS, so there has to be something else. I find it hard to believe that Larry Ellison would force Windows users to install a bloated MicroSoft IDE, just to be able to make a client connection (plus it already works using dbeaver).

I don't know if that's enough for some brilliant Cygwin/Python/Oracle developer to answer my question ... so, hit me up for more details.

TIA

Chris -the DW worker bee

Answers

  • user4565183
    user4565183 Member Posts: 3
    edited Oct 31, 2019 3:42PM

    Wow, well I had a feeling that if I typed up a question, that the pragmatic exercise of writing out what I know and don't know might set something loose.

    I got it working by doing a clean install (I just put it alone in a new directory) of the Oracle Instant client and then adjusting the cygwin PATH to include it. As I type it up now, it sounds so obvious but seriously, there is a LOT of mis-information and worse outdated information out on the web. One site would ask me to undo the steps I took in the previous article... I got myself confused and couldn't see clearly.

    The connection works and now I have to do my development... I may have additional issues. Thanks to anyone who took a look at this.

    Chris

    user4565183
  • user4565183
    user4565183 Member Posts: 3
    edited Oct 31, 2019 3:42PM

    My last apology... I can't seem to be able to mark my original question as closed/answered, etc.