Python distribution for Scientific / Maths / Data Analysis by Continuum.
- Key Points
- Install
- Create Environment
- Delete Environment
- Enter / Leave Environment
- Python Versions
- Packages
-
installs in home directory
-
binary packages available from Anaconda Cloud - can upload your own
-
select customize Anaconda installation and de-select Modify Path otherwise it'll change the bash profile
-
Anaconda appends path to
.bash_profile
otherwise, move to.bashrc
- manually add
~/anaconda/bin
to$PATH
in.bashrc
- manually add
-
removing Anaconda is simple
rm -fr ~/anaconda
- Anaconda Enterprise - expensive, manages deployments across nodes
- cheat workaround is to install open source + rsync to other nodes
https://docs.anaconda.com/miniconda/
or
https://docs.anaconda.com/anaconda/install/
Add to .bashrc:
export PATH="/opt/anaconda2/bin:$PATH"
alias python="/opt/anaconda2/bin/python2.7"
conda --version
conda info
Show all environments using -e
/ --envs
, *
denotes active ones:
conda info --envs
Update conda packager manager:
conda update conda
Update packages metadata:
conda update anaconda
Adds nose package to yaml key create_default_packages
in ~/.condarc
, so can create new envs without package args:
conda config --add create_default_packages nose
conda config --add channels pandas
Show all config keys or specify a key:
config config --get # [<key>]
Create environment with biopython
package in it using -n
/ --name
:
conda create --name "$env" "$pkg"
Clone from an existing env:
conda create -n "$env2" --clone "$env"
Create another environment with specific python version 3:
conda create -n "$env" python=3 "$pkg"
conda remove -n "$env" --all
source activate "$env"
source deactivate
From within an env:
conda env export > py26.yml
Create new env from saved config:
conda create "$env2" -f py26.yml
Show available python versions using -f
/ --full-name
:
conda search --full-name python
List installed packages in current env:
conda list
Search for package:
conda search "$pkg"
Specify -n
/ --name
or will install in current env:
conda install [-n "$env"] "$pkg'
conda update [-n "$env"] "$pkg"
Install from anaconda.org, search on anaconda.org and then specify specific channel's package:
conda install --channel https://conda.anaconda.org/pandas bottleneck
PIP - for stuff not available in Anaconda, activate the environment and then use pip as normal:
source activate "$env"
pip install "$pkg"
Show package was installed
conda list
Delete packages:
conda remove [-n "$env"] "$pkg" "$pkg2" ...
Search for stuff in a specific channel on https://anaconda.org:
conda search --override-channels -c pandas bottleneck
See if available from Anaconda repository:
conda search --override-channels -c defaults beautiful-soup
Build a conda package from PIP:
conda skeleton pypi "$package"
conda build "$package"
Ported from private Knowledge Base Python page 2019+