-
Notifications
You must be signed in to change notification settings - Fork 3
/
anaconda.txt
94 lines (69 loc) · 3.32 KB
/
anaconda.txt
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Downlad link
https://www.anaconda.com/download/#linux
# Check version of Anaconda metapackage
python --version
# Downgrade python version
conda install python=3.5
# Install non-interactively (-b: batch, -f: no error if prefix exists)
# Optional: sudo apt-get -y install bzip2
wget https://repo.anaconda.com/archive/Anaconda3-2019.03-Linux-x86_64.sh -O Anaconda.sh \
&& bash Anaconda.sh -bf \
&& echo 'export PATH=$HOME/anaconda3/bin:$PATH' >> ~/.bashrc \
&& rm Anaconda.sh \
&& source ~/.bashrc
bash Anaconda3-5.1.0-Linux-x86_64.sh -bf && echo 'export PATH=$HOME/anaconda3/bin:$PATH' >> ~/.bashrc
# Init installation
conda init
# Do NOT activate base environment on startup
conda config --set auto_activate_base false
# OR
cat <<EOF > ~/.condarc
auto_activate_base: false
EOF
# http://davebehnke.com/using-python-anaconda-distribution.html
conda info -e
conda info --all
conda create -h
conda create -n python3 python=3.3 ipython-notebook pip numpy
source activate python3
source deactivate
conda search "^python$"
conda remove flask
# https://github.com/ContinuumIO/anaconda-issues/issues/368
ImportError: /lib64/libpangoft2-1.0.so.0: undefined symbol: FcWeightToOpenType
conda install -c asmeurer pango
# Create environment and add to notebook kernels
conda create -n py27 python=2.7 ipykernel
conda create -n py36 python=3.6 ipykernel
# https://ipython.readthedocs.io/en/stable/install/kernel_install.html
source activate myenv
python -m ipykernel install --user --name myenv --display-name "Python (myenv)"
# Cross environments kernel
/path/to/kernel/env/bin/python -m ipykernel install --prefix=/path/to/jupyter/env --name 'python-my-env'
# Create environment using yaml
# https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html
conda env create -n myenv -f environment.yaml
# List environment
conda env list
# Activate environment
conda activate myenv
# Remove / Delete environment
conda remove -n myenv --all
# Docker image
# https://hub.docker.com/r/continuumio/anaconda3/
docker run -di -t -p 8888:8888 continuumio/anaconda3 /bin/bash -c "/opt/conda/bin/conda install jupyter -y --quiet && mkdir /opt/notebooks && /opt/conda/bin/jupyter notebook --notebook-dir=/opt/notebooks --ip='*' --port=8888 --no-browser --allow-root"
# To run without password --NotebookApp.token=''
# New example
docker run --rm -it --net host continuumio/anaconda3:2019.10 /bin/bash -c "/opt/conda/bin/conda install jupyter -y --quiet && mkdir /opt/notebooks && /opt/conda/bin/jupyter notebook --notebook-dir=/opt/notebooks --ip='*' --port=8888 --no-browser --allow-root" --NotebookApp.token=''
# For non-interactive usage, using a specific Conda environment,
# it is useful to create a wrapper
# https://pypi.org/project/exec-wrappers/
create-wrappers -t conda --bin-dir /opt/conda/envs/myenv \
--conda-env-dir /opt/conda/envs/myenv --dest-dir /opt/conda_wrappers
# Then, the following python will contain the correct one
/opt/conda_wrappers/python
# Alternatively, ALWAYS install to root environment
conda env update -n root -f /tmp/environment.yaml
# Useful extensions: ExecuteTime
# https://jupyter-contrib-nbextensions.readthedocs.io/en/latest/install.html
conda install -y -q -c conda-forge jupyter_contrib_nbextensions jupyter_nbextensions_configurator