Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After using the pyinstaller packager, an error message is reported when it is run #669

Open
jiangtaobian opened this issue Jul 23, 2024 · 3 comments
Labels

Comments

@jiangtaobian
Copy link

  1. What versions are you using?
    platform.platform: Windows-10-10.0.22631-SP0
    sys.maxsize > 2**32: True
    platform.python_version: 3.9.13
    cx_Oracle.version: 8.3.0
    cx_Oracle.clientversion: (11, 2, 0, 4, 0)
  1. Describe the problem

Packing command:pyinstaller.exe --add-binary='D:\instantclient_11_2*':. --onefile .\myscript.py

Error information:
Traceback (most recent call last):
File "myscript.py", line 1, in
ModuleNotFoundError: No module named 'cx_Oracle'
[10136] Failed to execute script 'oadoc' due to unhandled exception!

  1. Include a runnable Python script that shows the problem.

'''
import cx_Oracle
hostname = 'my_hostname'
port = 'port'
service_name = 'service_name'
username = 'username'
password = 'password'

conn = cx_Oracle.connect(f"{username}/{password}@{hostname}:{port}/{service_name}")
print(conn)

conn.close()
'''

@cjbj
Copy link
Member

cjbj commented Jul 23, 2024

Please upgrade to python-oracledb, and review oracle/python-oracledb#31

@jiangtaobian
Copy link
Author

jiangtaobian commented Jul 26, 2024

noticed this message when I attemp to use python-oracledb:
DPY-3010: connections to this database server version are not supported by python-oracledb in thin mode

Oracle Version:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production

@cjbj
Copy link
Member

cjbj commented Jul 26, 2024

python-oracledb has a Thick mode that is equivalent to cx_Oracle, and will connect to Oracle Database 11gR2, so you should upgrade to python-oracledb. You'll need to install Oracle Instant Client on the target machine, and add a call to init_oracle_client() to your code which will enable Thick mode and load Instant Client libraries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants