Skip to content

Commit

Permalink
Revert "fix: conflicting DLLs in Path variable (#344)"
Browse files Browse the repository at this point in the history
This reverts commit df59629.
  • Loading branch information
RobPasMue committed Nov 6, 2024
1 parent 931c546 commit c0b8194
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions src/ansys/tools/installer/installed_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,16 +541,6 @@ def launch_cmd(
always_use_pip : bool, default: False
Whether to always use pip for the command or not.
"""
path = os.environ["PATH"].split(";")
altered_path = path.copy()
for p in path:
if (
"Ansys Python Manager\_internal" in p
or "ansys_python_manager\_internal" in p
):
altered_path.remove(p)
myenv = ";".join(altered_path)

# Handle unexpected bool parameter for linux
if is_linux_os() and isinstance(extra, bool):
extra = ""
Expand All @@ -577,8 +567,7 @@ def launch_cmd(

if is_vanilla_python and not is_venv:
scripts_path = os.path.join(py_path, "Scripts")

new_path = f"{py_path};{scripts_path};{myenv}"
new_path = f"{py_path};{scripts_path};%PATH%"

if extra:
cmd = f"&& {extra}"
Expand All @@ -602,7 +591,7 @@ def launch_cmd(
run_linux_command(py_path, extra, True)
else:
subprocess.call(
f'start {min_win} cmd /K "set PATH={myenv} && {py_path}\\Scripts\\activate.bat && cd %userprofile% {cmd}"',
f'start {min_win} cmd /K "{py_path}\\Scripts\\activate.bat && cd %userprofile% {cmd}"',
shell=True,
)
elif not is_vanilla_python and is_venv:
Expand All @@ -619,7 +608,7 @@ def launch_cmd(
run_linux_command_conda(py_path, extra, True)
else:
subprocess.call(
f'start {min_win} cmd /K "set PATH={myenv} && {miniforge_path}\\Scripts\\activate.bat && conda activate {py_path} && cd %userprofile% {cmd}"',
f'start {min_win} cmd /K "{miniforge_path}\\Scripts\\activate.bat && conda activate {py_path} && cd %userprofile% {cmd}"',
shell=True,
)
else:
Expand All @@ -636,6 +625,6 @@ def launch_cmd(
run_linux_command_conda(py_path, extra, False)
else:
subprocess.call(
f'start {min_win} cmd /K "set PATH={myenv} && {miniforge_path}\\Scripts\\activate.bat && conda activate {py_path} && cd %userprofile% {cmd}"',
f'start {min_win} cmd /K "{miniforge_path}\\Scripts\\activate.bat && conda activate {py_path} && cd %userprofile% {cmd}"',
shell=True,
)

0 comments on commit c0b8194

Please sign in to comment.