doyubkim / fluid-engine-dev

Fluid simulation engine for computer graphics applications

Home Page:https://fluidenginedevelopment.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python API import error on Windows and Python 3.8+ with Intel TBB

utilForever opened this issue · comments

I encountered Python API import error while updating CubbyFlow.

import pyjet
ImportError: DLL load failed while importing pyjet:
The specified module could not be found. 

At first, I thought it was my problem, but after a few days of investigation, I found that there is a new Windows safety feature that changes how DLLs are loaded in Python 3.8.
To resolve this issue, I needed to tell Python how to find the library again like this:

import os
os.add_dll_directory(r'C:/Intel/tbb/bin/intel64/vc14') << (The path that Intel TBB is located)
import pyjet

I think we should add this situation and solution to README.md or INSTALL.md. What do you think?

Is this still an issue if PATH env variable contains TBB?

Yes, it is.

Ok that’s unfortunate 🙁 I’m starting to think if pyjet should use tbb from pypi. Having extra function call for every pyjet import doesn’t look nice.

I agree. So I suggest adding this issue to documents such as README.md or INSTALL.md. 🤔

It should be a temporary warning message in the docs before we have proper fix. Do you mind posting a PR for that?

Yes, I’ll post PR tonight. :)
Do you want to add warning messages to Install.md?

@utilForever Not sure why I missed your last comment. Yup, that sounds good!

@doyubkim Okay. I'll post PR tonight after I add warning messages. 😀

I'm also making some experiments to address general distribution issues with TBB. I think we should build and deploy the version of TBB that's been used with the Jet build. Hope I can come up with something to share soon.

@doyubkim Not sure why I missed this issue. I'll post PR tonight after work. 📜