Skip to content

Commit

Permalink
Update install.sh to use PYBIN
Browse files Browse the repository at this point in the history
  • Loading branch information
lanctot authored Nov 7, 2022
1 parent 25c8055 commit ddc63a9
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions open_spiel/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ die() {
set -e # exit when any command fails
set -x # show evaluation trace

PYBIN=${PYBIN:-"python${OS_PYTHON_VERSION}"}
PYBIN=${PYBIN:-"python"}
PYBIN=${PYBIN:-"python3"}
PYBIN=`which $PYBIN`

MYDIR="$(dirname "$(realpath "$0")")"

# Calling this file from the project root is not allowed,
Expand Down Expand Up @@ -279,8 +284,8 @@ elif [[ "$OSTYPE" == "darwin"* ]]; then # Mac OSX
brew list [email protected] && brew unlink [email protected]
brew link --force --overwrite "python@${OS_PYTHON_VERSION}"
fi
`python -c "import tkinter" > /dev/null 2>&1` || brew install tcl-tk || echo "** Warning: failed 'brew install tcl-tk' -- continuing"
python --version
`${PYBIN} -c "import tkinter" > /dev/null 2>&1` || brew install tcl-tk || echo "** Warning: failed 'brew install tcl-tk' -- continuing"
${PYBIN} --version
[[ -x `which clang++` ]] || die "Clang not found. Please install or upgrade XCode and run the command-line developer tools"
[[ -x `which curl` ]] || brew install curl || echo "** Warning: failed 'brew install curl' -- continuing"
if [[ ${OPEN_SPIEL_BUILD_WITH_GO:-"OFF"} == "ON" ]]; then
Expand All @@ -294,8 +299,8 @@ elif [[ "$OSTYPE" == "darwin"* ]]; then # Mac OSX
fi

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
python -m pip install virtualenv
${PYBIN} get-pip.py
${PYBIN} -m pip install virtualenv
else
echo "The OS '$OSTYPE' is not supported (Only Linux and MacOS is). " \
"Feel free to contribute the install for a new OS."
Expand Down

0 comments on commit ddc63a9

Please sign in to comment.