Skip to content

Commit

Permalink
Allow custom python (#884)
Browse files Browse the repository at this point in the history
The need for this came up in the context of installing monai label in Slicer's python environment where the interpreter executable is called `PythonSlicer`

This change allows users to set an environment variable to select the python version.
  • Loading branch information
pieper authored Jul 24, 2022
1 parent 72a388a commit 1ad1287
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions monailabel/scripts/monailabel
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." >/dev/null 2>&1 && pwd)"
export PYTHONPATH=$DIR:$PYTHONPATH
echo Using PYTHONPATH=$PYTHONPATH

PYEXE=python
version=$(python --version 2>&1)
PYEXE=${MONILABEL_PYEXE:-python}
version=$(${PYEXE} --version 2>&1)
if echo "$version" | grep "Python 2"; then
echo "Trying python3 instead of python ($version)"
PYEXE=python3
Expand Down

0 comments on commit 1ad1287

Please sign in to comment.