Skip to content

Commit c0b8194

Browse files
committed
Revert "fix: conflicting DLLs in Path variable (#344)"
This reverts commit df59629.
1 parent 931c546 commit c0b8194

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

src/ansys/tools/installer/installed_table.py

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -541,16 +541,6 @@ def launch_cmd(
541541
always_use_pip : bool, default: False
542542
Whether to always use pip for the command or not.
543543
"""
544-
path = os.environ["PATH"].split(";")
545-
altered_path = path.copy()
546-
for p in path:
547-
if (
548-
"Ansys Python Manager\_internal" in p
549-
or "ansys_python_manager\_internal" in p
550-
):
551-
altered_path.remove(p)
552-
myenv = ";".join(altered_path)
553-
554544
# Handle unexpected bool parameter for linux
555545
if is_linux_os() and isinstance(extra, bool):
556546
extra = ""
@@ -577,8 +567,7 @@ def launch_cmd(
577567

578568
if is_vanilla_python and not is_venv:
579569
scripts_path = os.path.join(py_path, "Scripts")
580-
581-
new_path = f"{py_path};{scripts_path};{myenv}"
570+
new_path = f"{py_path};{scripts_path};%PATH%"
582571

583572
if extra:
584573
cmd = f"&& {extra}"
@@ -602,7 +591,7 @@ def launch_cmd(
602591
run_linux_command(py_path, extra, True)
603592
else:
604593
subprocess.call(
605-
f'start {min_win} cmd /K "set PATH={myenv} && {py_path}\\Scripts\\activate.bat && cd %userprofile% {cmd}"',
594+
f'start {min_win} cmd /K "{py_path}\\Scripts\\activate.bat && cd %userprofile% {cmd}"',
606595
shell=True,
607596
)
608597
elif not is_vanilla_python and is_venv:
@@ -619,7 +608,7 @@ def launch_cmd(
619608
run_linux_command_conda(py_path, extra, True)
620609
else:
621610
subprocess.call(
622-
f'start {min_win} cmd /K "set PATH={myenv} && {miniforge_path}\\Scripts\\activate.bat && conda activate {py_path} && cd %userprofile% {cmd}"',
611+
f'start {min_win} cmd /K "{miniforge_path}\\Scripts\\activate.bat && conda activate {py_path} && cd %userprofile% {cmd}"',
623612
shell=True,
624613
)
625614
else:
@@ -636,6 +625,6 @@ def launch_cmd(
636625
run_linux_command_conda(py_path, extra, False)
637626
else:
638627
subprocess.call(
639-
f'start {min_win} cmd /K "set PATH={myenv} && {miniforge_path}\\Scripts\\activate.bat && conda activate {py_path} && cd %userprofile% {cmd}"',
628+
f'start {min_win} cmd /K "{miniforge_path}\\Scripts\\activate.bat && conda activate {py_path} && cd %userprofile% {cmd}"',
640629
shell=True,
641630
)

0 commit comments

Comments
 (0)