oracle / python-oracledb

Python driver for Oracle Database conforming to the Python DB API 2.0 specification. This is the renamed, new major release of cx_Oracle
https://oracle.github.io/python-oracledb
Other
307 stars 59 forks source link

Having issue setting up the connection with oracle database using oracledb module #306

Closed jyonag closed 2 months ago

jyonag commented 3 months ago

Discussed in https://github.com/oracle/python-oracledb/discussions/305

Originally posted by **jyonag** March 5, 2024 Tried to install oracledb in my VM but couldnt do it because of the network firewalls. I tied to install install them locally and copied the file and folders to python "C:\Program Files (x86)\Python38-32\site-packages" ![image](https://github.com/oracle/python-oracledb/assets/152456571/45321dc3-5f65-43ff-b27f-f96091e1ba50) I created sample program to test the db connection test.py ![image](https://github.com/oracle/python-oracledb/assets/152456571/7bd3770e-a5a3-4a77-85df-d5b9ec2215bc) When I tried to test the connection. I got error as follows ![image](https://github.com/oracle/python-oracledb/assets/152456571/5b0081ff-10e9-4a3f-ae1c-812b0cc93d08) C:\Program Files (x86)\Python38-32\site-packages>python test.py Traceback (most recent call last): File "test.py", line 3, in import oracledb File "C:\Program Files (x86)\Python38-32\site-packages\oracledb\__init__.py", line 169, in from .connection import ( File "C:\Program Files (x86)\Python38-32\site-packages\oracledb\connection.py", line 45, in from . import base_impl, thick_impl, thin_impl ImportError: cannot import name 'base_impl' from partially initialized module 'oracledb' (most likely due to a circular import) (C:\Program Files (x86)\Python38-32\site-packages\oracledb\__init__.py)
anthony-tuininga commented 3 months ago

That error will happen if the base_impl module cannot be imported for some reason. Common reasons are permissions issues, wrong architecture (32-bit vs 64-bit) and redistributables missing. You will have to find out what the real issue is. I don't do much work on Windows so am not familiar with the techniques of tracking this down. Someone else with more Windows experience may be able to help. On Linux you would use a program like strace to track which call is actually failing. I might be able to try replicate on Windows and see if there is a good way to figure it out. If I do, I'll let you know!

cjbj commented 2 months ago

Closing - no activity.