Skip to content

Commit 04329ee

Browse files
Merge pull request #2348 from AI-Hypercomputer:check_correct_py_env
PiperOrigin-RevId: 807395598
2 parents fcfdec5 + d650ed2 commit 04329ee

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

src/install_maxtext_extra_deps/install_github_deps.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,25 @@
1818

1919
def main():
2020
"""
21-
Installs extra dependencies specified in extra_deps.txt using uv.
21+
Installs extra dependencies specified in extra_deps_from_github.txt using uv.
2222
23-
This script looks for 'extra_deps.txt' relative to its own location.
23+
This script looks for 'extra_deps_from_github.txt' relative to its own location.
2424
It executes 'uv pip install -r <path_to_extra_deps.txt> --resolution=lowest'.
2525
"""
2626
script_dir = Path(__file__).resolve().parent
2727

28-
# Adjust this path if your extra_deps.txt is in a different location,
28+
# Adjust this path if your extra_deps_from_github.txt is in a different location,
2929
# e.g., script_dir / "data" / "extra_deps_from_github.txt"
3030
extra_deps_file = script_dir / "extra_deps_from_github.txt"
3131

3232
if not extra_deps_file.exists():
3333
print(f"Error: '{extra_deps_file}' not found.")
34-
print("Please ensure 'extra_deps.txt' is in the correct location relative to the script.")
34+
print("Please ensure 'extra_deps_from_github.txt' is in the correct location relative to the script.")
3535
sys.exit(1)
36-
# Check if 'uv' is available in the system's PATH
36+
# Check if 'uv' is available in the environment
3737
try:
38-
subprocess.run(["uv", "--version"], check=True, capture_output=True)
39-
except FileNotFoundError:
40-
print("Error: 'uv' command not found.")
41-
subprocess.run(["pip", "install", "uv"], check=True)
42-
subprocess.run(["uv", "--version"], check=True, capture_output=True)
43-
sys.exit(1)
38+
subprocess.run([sys.executable, "-m", "pip", "install", "uv"], check=True, capture_output=True)
39+
subprocess.run([sys.executable, "-m", "uv", "--version"], check=True, capture_output=True)
4440
except subprocess.CalledProcessError as e:
4541
print(f"Error checking uv version: {e}")
4642
print(f"Stderr: {e.stderr.decode()}")

0 commit comments

Comments
 (0)