forked from C0untFloyd/roop-unleashed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runMacOS.sh
48 lines (39 loc) · 1.32 KB
/
runMacOS.sh
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
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
# Check if we are in the correct repository directory
if [ ! -f "run.py" ]; then
echo "run.py not found!"
exit 1
fi
# Create a hidden Python 3.11 virtual environment in the .venv folder
VENV_DIR=".venv"
# Check if Python 3.11 is installed
if ! brew list --versions python@3.11 >/dev/null; then
echo "Python 3.11 is not installed. Please install it first."
exit 1
fi
# Use Python 3.11 to create the virtual environment
echo "Creating a virtual environment using Python 3.11..."
python3.11 -m venv $VENV_DIR
# Activate the virtual environment
echo "Activating the virtual environment..."
source "$VENV_DIR/bin/activate"
# Check if the activation was successful
if [ "$VIRTUAL_ENV" != "" ]; then
echo "Virtual environment activated successfully."
else
echo "Failed to activate the virtual environment."
exit 1
fi
# Install dependencies from requirements.txt
if [ -f "requirements.txt" ]; then
echo "Installing dependencies from requirements.txt..."
pip install -r requirements.txt
else
echo "requirements.txt not found. Skipping dependency installation."
fi
# Run roop-unleashed. This can take a while - especially at first startup...
echo "Running the run.py script..."
python run.py
# Deactivate the virtual environment after execution
echo "Deactivating the virtual environment..."
deactivate