Skip to content

Conversation

ekomarova
Copy link
Collaborator

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

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

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

@antonwolfy antonwolfy left a comment

Choose a reason for hiding this comment

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

Thank you @ekomarova

@ekomarova ekomarova merged commit 9d6fdc6 into master Mar 24, 2025
15 of 27 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.

2 participants