forked from jmschrei/pomegranate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rebuildconda
executable file
·58 lines (46 loc) · 1.8 KB
/
rebuildconda
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
53
54
55
56
57
58
#!/bin/bash
# Setting up conda:
# Pass in the version of python as an argument with default of 2.7
########## Current setup BEGIN:
_PYVER=${1:-2.7}
#_PYVER=2.7
#_PYVER=3.4
#_PYVER=3.6
penv_version=py${_PYVER}
echo rebuilding conda environment $penv_version
# List envs:
conda info --envs
# List all info:
conda info -a
source deactivate
conda env remove --yes --name $penv_version
conda create --yes --name $penv_version python=${_PYVER} ; source activate $penv_version
conda config --get channels
conda config --add channels conda-forge
conda config --get channels
# wip add packages that should be in base:
base_packages=" cython "
pom_packages=" scipy joblib nose networkx=1.11 "
pom_nbtest_packages=" scikit-learn pandas seaborn pygraphviz pillow xlrd memory_profiler jupyter jupyter_contrib_nbextensions jupyter_nbextensions_configurator "
echo "Don't forget to also install gnuplot-py since it isn't yet in the tools Makefile"
conda install --yes $base_packages $pom_packages $pom_nbtest_packages
source activate $penv_version
# It would be nice if cmckeague would submit libpgm to conda-forge... Also doesn't have a python 3 version
if [ ${penv_version/py2.7.*/py2.7} == "py2.7" ]; then
conda install --yes -c cmckeague libpgm
# Note that omnia hmmlearn causes numpy downgrade to 1.12.1
conda install --yes -c omnia hmmlearn
fi
conda env export > $penv_version.yml
########## Current setup END
#
exit 0
########## Current setup Remove:
source deactivate
conda env remove --yes --name $penv_version
##########
########## Purge packages:
conda clean --dry-run --all
########## Bash aliases for quick change of environment:
alias py27="source activate py2.7; p=~/miniconda2/envs/py2.7/lib/python2.7/site-packages "
alias py36="source activate py3.6; p=~/miniconda2/envs/py3.6/lib/python3.6/site-packages "