-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmake-conda-environment.sh
More file actions
52 lines (34 loc) · 1.01 KB
/
make-conda-environment.sh
File metadata and controls
52 lines (34 loc) · 1.01 KB
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
44
45
46
47
48
49
50
51
52
#!/bin/bash
MANAGER="mamba"
NAME="supergraph"
LIBRARIES=(
python
matplotlib
python-igraph
mysqlclient
pyyaml pandas scipy tqdm colorama neo4j-python-driver networkx seaborn scikit-learn numba python-louvain
leidenalg
dask
fa2
)
CHANNELS=(
defaults
)
# ---
COLOR="\033[40m\033[32m"
UNCOLOR="\033[0m"
# ------------ setup
# only required if "anaconda" is not in the path
source $HOME/$MY_CONDA_INSTALLATION/etc/profile.d/conda.sh
# from https://stackoverflow.com/a/9429887/3967334
LIBRARIES_CONCATENATED=$(IFS=" " ; echo "${LIBRARIES[*]}")
# from https://stackoverflow.com/a/17841619/3967334
function join_by { local d=${1-} f=${2-}; if shift 2; then printf %s "$f" "${@/#/$d}"; fi; }
CHANNELS_CONCATENATED=$(join_by ' -c ' "${CHANNELS[@]}")
# ------------ installation
$MANAGER create --yes -n $NAME $LIBRARIES_CONCATENATED -c $CHANNELS_CONCATENATED
# ------------ pip
conda activate $NAME
# pip stuff here....
# ------------
echo -e new environment is \"$COLOR$NAME$UNCOLOR\"