# Get list of already set up environments
conda env list
# Create an environment with specified python version
conda create -n py36 python=3.6 anaconda
# Create environment without prompting for yes/no and quiet mode
conda create -y -q -n py36 python=3.6
# Activate an already setup environment
conda activate envName
# Close the conda environment
conda deactivate envName
# Install packages
conda install packagename
# Delete a no longer used environemnt
conda remove -n envName --all
## Export environment
conda activate envName
conda env export > environment.yml
Appropriate version from here e.g. v.3.5.1.0 for linux
Original manual for installation instructions here
bash Anaconda3-5.1.0-Linux-x86_64.sh
Optional
Check if you ~/.bash_profile
file contains path to Anaconda bin. On my mac, the installer autmatically exported its path, but on my linux machine, I had to do it manually. You will get a conda command not found
error if the path is missing.
Add the following line to your ~/.bash_profile
file
export PATH="$HOME/anaconda3/bin:$PATH"
Source to make sure the changes take for the current terminal session
source ~/.bash_profile
You can search Anaconda website to see the wide list of packages that could be installed and setup. The most common ones are Python versions (2.7, 3.6), numpy.
Using Python 3.6 setup as an example:
You can give the environment any name of your choosing. But using a short descriptive one like below is good practice
conda create -n py36 python=3.6 anaconda
Activate this newly created environment
conda activate py36
Check if everything is ok
python --version
You can now install local packages of our choosing in this python environment !
After you are done, simply close the environment
conda deactivate
If you set up environments a while back and don't quite remember what the names were, you can always check using
conda env list
Or
conda info --envs
conda info
If you are an advanced user needing more details
conda info -a
conda config --add channels defaults
conda config --add channels bioconda
conda config --add channels conda-forge
Commands in order of preference
conda update conda
Or
conda update -n base -c defaults conda
or
conda update -n base conda
Remove entire installation directory
rm -rf ~/anaconda3
Remove hidden files
rm -rf ~/.condarc ~/.conda ~/.continuum
Source: https://github.com/thw17/BIO598_Tutorial
source activate envName
conda env export > environment.yml
sed '$d' environment.yml > environment.yml
## not checked
sed -i.bak '/^prefix/d' environment.yml
conda env create -f environment.yml