-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_env.py
More file actions
37 lines (29 loc) · 1011 Bytes
/
setup_env.py
File metadata and controls
37 lines (29 loc) · 1011 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env python3
"""
Virtual environment setup script for PDF Chunking System
"""
import subprocess
import sys
def main():
"""Setup virtual environment and install dependencies"""
print("Creating virtual environment...")
subprocess.run([sys.executable, "-m", "venv", ".venv"], check=True)
# Determine pip path
if sys.platform == "win32":
pip_path = ".venv\\Scripts\\pip"
else:
pip_path = ".venv/bin/pip"
print("Upgrading pip...")
subprocess.run([pip_path, "install", "--upgrade", "pip"], check=True)
print("Installing dependencies...")
subprocess.run([pip_path, "install", "-r", "requirements.txt"], check=True)
print("\nSetup complete!")
print("\nTo activate the virtual environment:")
if sys.platform == "win32":
print(" .venv\\Scripts\\activate")
else:
print(" source .venv/bin/activate")
print("\nTo deactivate, run:")
print(" deactivate")
if __name__ == "__main__":
main()