[inductor] Fix inductor windows linker error (#150256)

Fixes #149889

Pull Request resolved: https://github.com/pytorch/pytorch/pull/150256
Approved by: https://github.com/anijain2305, https://github.com/eellison
This commit is contained in:
Jason Ansel 2025-04-01 03:24:34 +00:00 committed by PyTorch MergeBot
parent 15dbad2115
commit 37ebb0b56a

View File

@ -838,8 +838,13 @@ def _get_python_related_args() -> tuple[list[str], list[str]]:
python_include_dirs.append(python_include_path)
if _IS_WINDOWS:
python_path = os.path.dirname(sys.executable)
python_lib_path = [os.path.join(python_path, "libs")]
python_lib_path = [
str(
(
Path(sysconfig.get_path("include", scheme="nt")).parent / "libs"
).absolute()
)
]
else:
python_lib_path = [sysconfig.get_config_var("LIBDIR")]