Skip to content

Commit 7039739

Browse files
author
Adám Brudzewsky
authored
Merge pull request Dyalog#67 from stefco/conda-environment-support
add support for conda environments to install.sh
2 parents 7de5212 + d2db0a9 commit 7039739

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

install.sh

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,29 @@
22
set -e
33

44
BASEDIR=$(dirname "$0")
5+
PYVER="$(python3 --version | sed 's/.*\(3\.[0-9]*\).*/\1/')"
6+
7+
if [ -z "$CONDA_PREFIX" ]
8+
then
9+
case $(uname) in
10+
Darwin) KERNELDIR=~/Library/Jupyter/kernels ;;
11+
Linux) KERNELDIR=~/.local/share/jupyter/kernels ;;
12+
*) exit 1
13+
esac
14+
SITEDIR="$(python3 -m site --user-site)"
15+
CONDIR="$HOME/anaconda3/lib/python$PYVER/site-packages"
16+
else
17+
KERNELDIR="$CONDA_PREFIX"/share/jupyter/kernels
18+
SITEDIR="$CONDA_PREFIX/lib/python$PYVER"
19+
CONDIR="$SITEDIR"/site-packages
20+
fi
521

6-
case $(uname) in
7-
Darwin) KERNELDIR=~/Library/Jupyter/kernels ;;
8-
Linux) KERNELDIR=~/.local/share/jupyter/kernels ;;
9-
*) exit 1
10-
esac
1122
mkdir -p "$KERNELDIR"
1223
cp -r "$BASEDIR"/dyalog-kernel "$KERNELDIR"/
1324

14-
SITEDIR="$(python3 -m site --user-site)"
1525
mkdir -p "$SITEDIR"
1626
cp -r "$BASEDIR"/dyalog_kernel "$SITEDIR"/
1727

18-
CONDIR="$HOME/anaconda3/lib/python3.*/site-packages"
1928
if [ -d "$CONDIR" ] ; then
2029
cp -r "$BASEDIR"/dyalog_kernel "$CONDIR"/
2130
fi

0 commit comments

Comments
 (0)