Skip to content

Commit

Permalink
fix: executable path in windows (#1441)
Browse files Browse the repository at this point in the history
* add Scripts folder

Signed-off-by: Aryan-Rajoria <57455619+Aryan-Rajoria@users.noreply.github.com>

* add seperate bin_dir for venv and conda

Signed-off-by: Aryan-Rajoria <57455619+Aryan-Rajoria@users.noreply.github.com>

---------

Signed-off-by: Aryan-Rajoria <57455619+Aryan-Rajoria@users.noreply.github.com>
  • Loading branch information
aryan-rajoria authored Nov 5, 2024
1 parent b322200 commit 766bd60
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions lib/helpers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -10727,16 +10727,18 @@ function get_python_command_from_env(env) {
const python3_exe_name = isWin ? "python3.exe" : "python3";
let python_cmd_to_use = PYTHON_CMD;
if (env.VIRTUAL_ENV) {
if (existsSync(join(env.VIRTUAL_ENV, "bin", python_exe_name))) {
python_cmd_to_use = join(env.VIRTUAL_ENV, "bin", python_exe_name);
} else if (existsSync(join(env.VIRTUAL_ENV, "bin", python3_exe_name))) {
python_cmd_to_use = join(env.VIRTUAL_ENV, "bin", python3_exe_name);
const bin_dir = isWin ? "Scripts" : "bin";
if (existsSync(join(env.VIRTUAL_ENV, bin_dir, python_exe_name))) {
python_cmd_to_use = join(env.VIRTUAL_ENV, bin_dir, python_exe_name);
} else if (existsSync(join(env.VIRTUAL_ENV, bin_dir, python3_exe_name))) {
python_cmd_to_use = join(env.VIRTUAL_ENV, bin_dir, python3_exe_name);
}
} else if (env.CONDA_PREFIX) {
if (existsSync(join(env.CONDA_PREFIX, "bin", python_exe_name))) {
python_cmd_to_use = join(env.CONDA_PREFIX, "bin", python_exe_name);
} else if (existsSync(join(env.CONDA_PREFIX, "bin", python3_exe_name))) {
python_cmd_to_use = join(env.CONDA_PREFIX, "bin", python3_exe_name);
const bin_dir = isWin ? "" : "bin";
if (existsSync(join(env.CONDA_PREFIX, bin_dir, python_exe_name))) {
python_cmd_to_use = join(env.CONDA_PREFIX, bin_dir, python_exe_name);
} else if (existsSync(join(env.CONDA_PREFIX, bin_dir, python3_exe_name))) {
python_cmd_to_use = join(env.CONDA_PREFIX, bin_dir, python3_exe_name);
}
} else if (env.CONDA_PYTHON_EXE) {
python_cmd_to_use = env.CONDA_PYTHON_EXE;
Expand Down

0 comments on commit 766bd60

Please sign in to comment.