Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1042119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:27:27+00:00 2026-05-16T15:27:27+00:00

I have some small python apps that use cx_Oracle to connect to an Oracle

  • 0

I have some small python apps that use cx_Oracle to connect to an Oracle database. I deploy these apps by compiling them with py2exe, which works fine in many cases.

The problem is, there is no standard Oracle Client version (9i and 10g for example) across the many people who need to install this, and it would be very frustrating to try to get everyone to standardize on a single Oracle Client version. I’m using the 9.2 client with cx_Oracle 4.4.1 for 9i at the moment, and so when I py2exe the resulting exe includes the cx_Oracle 4.4.1 library and will not work with 10g clients.

I don’t use any specific features of any of the Oracle versions so there’s really no reason for me to care what client version is being used, except for the cx_Oracle compatibility issues.

The ideal solution would be to somehow compile a version that is completely independent of the Oracle Client installed on the machine.

If that’s not possible, I would be willing to compile separate exes for each major Oracle version (my_app_9i.exe, my_app_10g.exe, etc) but I can’t figure out an easy way to even do this since installing a new cx_Oracle overwrites my old version, I would have to keep swapping the library back and forth to compile the other versions whenever I make a change.

Any advice or other options are welcome.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T15:27:27+00:00Added an answer on May 16, 2026 at 3:27 pm

    If you want to build multiple cx_Oracle versions (eg: cx_Oracle10g, cx_Oracle11g, etc.) then you’ll need to modify the cx_Oracle setup.py script. The last step in the script is a call to setup(); the first parameter is the name of the module to build. All you need to do is to change "cx_Oracle" to "cx_Oracle" + ver, where ver is 10g, 11g, etc. Either create several scripts and hard-code it, or add another parameter to setup.py to select it dynamically.

    Of course, once you’ve got that, you need a mechanism to load the correct module at runtime. To do that you’ll want to create your own cx_Oracle module that has a __init__.py file that looks something like this:

    try:
      from cx_Oracle9g import *
    except ImportError:
      try:
        from cx_Oracle10g import *
      except ImportError:
        try:
          from cx_Oracle11g import *
    

    All you need to do is ship your custom cx_Oracle module plus the correct cx_OracleXg module with your application.

    Alternately, you could have your custom cx_Oracle module dynamically check for each available Oracle client library (9g, 10g, 11g, etc) and then only import the correct matching cx_OracleXg module. In this case, you only have to ship a single binary, containing your custom cx_Oracle module plus all of the cx_OracleXg modules.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a small Python application where I use PyGame for displaying some
I have some small python 2.6 scripts built.... Now, I would like run them
I have a small python script which draws some turtle graphics. When my script
I have some (small amount) of data that I'll need quick access to on
I have some text on a page that is small but readable in Chrome/Safari
So I wrote a small python script that allows me to specify some folder
I'm working on a Python web application in which I have some small modules
I have a small python script to make an installation. I need some information
I have some global variables in a Python script. Some functions in that script
I'm developing a small webshop that should have some payment options. My platform is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.