-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup_pythonOSX.sh
43 lines (36 loc) · 1.12 KB
/
setup_pythonOSX.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
#!/bin/bash
# Check for Homebrew, install if we don't have it
if test ! $(which brew); then
echo "Homebrew not found. Installing Homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
# Ensure Homebrew is up to date
brew update
# Check if Python is installed
if ! command -v python3 &> /dev/null; then
echo "Python not found. Installing Python..."
brew install python
else
echo "Python is already installed."
fi
# Ensure pip is up to date
echo "Updating pip..."
pip3 install --upgrade pip
# Check and install Python dependencies
declare -a packages=("pillow" "requests" "tk")
for package in "${packages[@]}"; do
if python3 -c "import $package" &> /dev/null; then
echo "$package is already installed."
else
echo "$package not found. Installing $package..."
pip3 install $package
fi
done
# Run the Python script
SCRIPT_NAME="TextureAtlas to GIF and Frames.py"
if [ -f "$SCRIPT_NAME" ]; then
echo "Running $SCRIPT_NAME..."
python3 "$SCRIPT_NAME"
else
echo "Error: $SCRIPT_NAME not found in the current directory."
fi