Skip to content

Conversation

@ekomarova
Copy link
Collaborator

@ekomarova ekomarova commented Mar 24, 2025

Since location of "Library\bin" in the virtual environment is not on the default search path, importing of mkl_umath and numpy fails.

This change introduces "_init_helper.py" file which implements the following logic using built-in os Python module:

  1. If os.add_dll_directory attribute exists, and VIRTUAL_ENV environment variable is set, and os.path.join(os.environ["VIRTUAL_ENV"], "Library", "bin") folder exists, call os.add_dll_directory with that directory

Copy link
Collaborator

@ndgrigorian ndgrigorian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty much identical to the fix in dpctl, LGTM!

@ekomarova ekomarova merged commit 50d0047 into main Mar 24, 2025
12 checks passed
@ekomarova ekomarova deleted the fix_import branch March 24, 2025 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants