-
Notifications
You must be signed in to change notification settings - Fork 0
/
mac_setup.command
executable file
·36 lines (31 loc) · 1.05 KB
/
mac_setup.command
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
#!/bin/bash
# This script is used to install the requirements for the project on a mac
#cd into the directory of the script
cd "$(dirname "$0")"
# Install homebrew if not already installed
if ! hash brew 2>/dev/null; then
echo "Installing homebrew"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
# find python or python3 executable
if hash python3 2>/dev/null; then
PIP_EXECUTABLE=pip3
elif hash python 2>/dev/null; then
# Confirm that python version is 3 or greater
PYTHON_VERSION=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:3])))')
if [[ $PYTHON_VERSION == 2* ]]; then
echo "Python version 3 or greater required"
brew install python3
PIP_EXECUTABLE=pip3
fi
PIP_EXECUTABLE=pip
else
echo "Python not found"
exit 1
fi
# Install system dependencies
echo "Installing system dependencies"
brew install portaudio python-tk
# Install python dependencies
echo "Installing python dependencies"
$PIP_EXECUTABLE install -r requirements.txt