try:
import os
import sys
# Get the path to the virtual environment's activation script
env_activate_path = os.path.join("env", "Scripts", "activate")
# Check if the virtual environment exists and the OS is Windows
if os.path.exists(env_activate_path) and sys.platform == "win32":
# Execute the activation script
activate_cmd = f'"{env_activate_path}"'
os.system(activate_cmd)
# Now you can continue with the rest of your script
print("Virtual environment activated!")
except:
print("unable to use virtual environment")