File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 1313from typing import List , Optional , Tuple , Union
1414
1515import torch
16+
17+
18+ def _init_dll_path ():
19+ """Initialize DLL search paths for Windows
20+
21+ On Windows Python-3.8+ has `os.add_dll_directory` call,
22+ which is called to configure dll search path.
23+ To find FFmpeg and other dependent dlls we need to make sure the
24+ conda environment/bin path and other system paths are configured.
25+ """
26+ if os .name == "nt" :
27+ for path in os .environ .get ("PATH" , "" ).split (";" ):
28+ if os .path .exists (path ):
29+ try :
30+ os .add_dll_directory (path )
31+ except Exception :
32+ # Ignore paths that can't be added
33+ pass
34+
35+
36+ # Initialize DLL paths on Windows before attempting to load libraries
37+ if os .name == "nt" :
38+ _init_dll_path ()
1639from torch .library import get_ctx , register_fake
1740
1841from torchcodec ._internally_replaced_utils import ( # @manual=//pytorch/torchcodec/src:internally_replaced_utils
You can’t perform that action at this time.
0 commit comments