mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
add python root bin to windows load path. (#146573)
This PR is extend python root bin path to dll load list. It makes PyTorch robust and compatible to more dependency libraries, such as `intel-pti`. Pull Request resolved: https://github.com/pytorch/pytorch/pull/146573 Approved by: https://github.com/EikanWang, https://github.com/albanD
This commit is contained in:
parent
90543e90a0
commit
2975664fb0
|
|
@ -167,6 +167,7 @@ if sys.platform == "win32":
|
|||
usebase_path = os.path.join(
|
||||
sysconfig.get_config_var("userbase"), "Library", "bin"
|
||||
)
|
||||
py_root_bin_path = os.path.join(sys.exec_prefix, "bin")
|
||||
|
||||
# When users create a virtualenv that inherits the base environment,
|
||||
# we will need to add the corresponding library directory into
|
||||
|
|
@ -179,7 +180,13 @@ if sys.platform == "win32":
|
|||
|
||||
dll_paths = [
|
||||
p
|
||||
for p in (th_dll_path, py_dll_path, base_py_dll_path, usebase_path)
|
||||
for p in (
|
||||
th_dll_path,
|
||||
py_dll_path,
|
||||
base_py_dll_path,
|
||||
usebase_path,
|
||||
py_root_bin_path,
|
||||
)
|
||||
if os.path.exists(p)
|
||||
]
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user