0

I am currently using an embedded python 3.8.5 installation, so that the installation of libraries has to be done by inserting unpacked library files into the lib/site-packages folder (https://files.pythonhosted.org/packages/5e/f1/2856a8773983af7e8dc32266ec969d77c6d34a35cb292f390bf27f007ce2/oracledb-1.3.1-cp311-cp311-win_amd64.whl).

In case of "import oracledb" the following problem occurs:

ImportError: cannot import name 'base_impl' from partially initialized module 'oracledb' (most likely due to a circular import)

I expected, that oracledb would run after the hands-on "installation" without problems in thin mode (obviously it doesn't). Following the package documentation, no drivers/ instantclients or similiar are needed for the default thin mode.

  • OS: Windows 10

Can anybody help?

thanks in advance!

1 Answer 1

1

The error isn't very explanatory but the problem is due to the fact that the base_impl module cannot be imported. Thin mode does not require any Oracle Client libraries but it does require an extension module written in Cython (packaged with oracledb). The reason it can't be imported is not due to the "circular import" reason suggested by the error but something else -- frequently things like the wrong architecture or a missing redistributable package. Check those conditions first! I will see if there is a way to improve the error message to find out the underlying condition and if so, update this answer.

2
  • Anthony, I run into a similar issue. In my case I was using conda, but VIRTUAL_ENV was pointing to different environment. Unsetting variable got rid of the error. If you prefer I can open issue on oracledb GitHub.
    – Slava
    Commented Jan 22, 2024 at 17:37
  • I would open an issue on GH with details or you can open a new question on StackOverflow if you prefer. Commented Jan 22, 2024 at 22:02

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.