Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pip install executable in command #851

Merged
merged 1 commit into from
May 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions runhouse/resources/packages/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,23 +281,23 @@ def _pip_install(
install_cmd: str, env: Union[str, "Env"] = "", cluster: "Cluster" = None
):
"""Run pip install."""
install_cmd = (
f"python3 -m {install_cmd}"
if cluster or env
else f"{sys.executable} -m {install_cmd}"
)

if env:
from runhouse.resources.envs.utils import _get_env_from

env = _get_env_from(env)
install_cmd = f"{env._run_cmd} {install_cmd}"
run_setup_command(install_cmd, cluster=cluster)
else:
cmd = (
f"python3 -m {install_cmd}"
if cluster
else f"{sys.executable} -m {install_cmd}"

retcode = run_setup_command(install_cmd, cluster=cluster)[0]
if retcode != 0:
raise RuntimeError(
"Pip install failed, check that the package exists and is available for your platform."
)
retcode = run_setup_command(cmd, cluster=cluster)[0]
if retcode != 0:
raise RuntimeError(
"Pip install failed, check that the package exists and is available for your platform."
)

@staticmethod
def _conda_install(
Expand Down
Loading