21 lines
558 B
Python
21 lines
558 B
Python
import venv
|
|
import subprocess
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
def main():
|
|
venv_path = Path(".venv")
|
|
if not venv_path.exists():
|
|
print("Creating virtual environment...")
|
|
venv.create(venv_path, with_pip=True)
|
|
|
|
pip_path = venv_path / "bin" / "pip" if sys.platform != "win32" else venv_path / "Scripts" / "pip.exe"
|
|
|
|
print("Installing dependencies...")
|
|
subprocess.run([str(pip_path), "install", "-r", "requirements.txt"])
|
|
|
|
print("Virtual environment setup complete.")
|
|
|
|
if __name__ == "__main__":
|
|
main()
|