File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -21,12 +21,16 @@ def _has_ops():
21
21
# To find cuda related dlls we need to make sure the
22
22
# conda environment/bin path is configured Please take a look:
23
23
# https://stackoverflow.com/questions/59330863/cant-import-dll-module-in-python
24
+ # Please note: if some path can't be added using add_dll_directory we simply ignore this path
24
25
if os .name == "nt" and sys .version_info >= (3 , 8 ) and sys .version_info < (3 , 9 ):
25
26
env_path = os .environ ["PATH" ]
26
27
path_arr = env_path .split (";" )
27
28
for path in path_arr :
28
29
if os .path .exists (path ):
29
- os .add_dll_directory (path ) # type: ignore[attr-defined]
30
+ try :
31
+ os .add_dll_directory (path ) # type: ignore[attr-defined]
32
+ except Exception :
33
+ pass
30
34
31
35
lib_path = _get_extension_path ("_C" )
32
36
torch .ops .load_library (lib_path )
You can’t perform that action at this time.
0 commit comments