INSTALLING AND USING CONDA



#Conda is an environment control package. It allows you to create a controlled environment in which multiple compatible versions of programs and their dependencies are installed and can work together. This environment can run with different versions of Python. Once the environment is running, then it can be used with different data sets and projects without fear that updates to one or more programs will cause compatibility issues. The environment file can also be shared so others can use it with their projects without having to install all the programs and worry about what versions of the different programs they have.



#Downloaded full Anaconda package from website: https://docs.conda.io/projects/conda/en/latest/index.html.

#Then go to terminal and in Anaconda folder (cd conda3) type:

bash Anaconda3-2021.05-Linux-x86_64.sh

#This command runs the installer #Follow the instructions that appear on the screen


#If you’d prefer that conda’s base environment not be activated on startup, set the auto_activate_base parameter to false:

conda config –set auto_activate_base false

#I used this option so “(base)” does not appear when I start a new terminal window

#To activate conda and enter “(base)”:

conda activate

#You should now see something like: “(base)waguirre@waguirre-VirtualBox~$”

#This indicates that you are in conda


#To create an environment, in the terminal type:

conda create –name myenv

#e.g., conda create –name stacks_test1

#This environment gets saved in the conda3/envs directory


#To activate the environment, type:

conda activate environment name

#e.g., conda activate stacks_test1


#To deactivate the environment, type:

conda deactivate environment name

#e.g., conda deactivate stacks_test1


#To see a list of your environments: conda info –envs


#To clone an environment, create an exact copy, use:

conda create –name myclone –clone myenv

#e.g., conda create –name stacks_test1_clone –clone stacks_test1


#Note that you can see what environment you are in by what is in parenthesis before the linux host

#e.g., “(base)waguirre@waguirre-VirtualBox”, Indicates that I am in base conda and not in any specific environment

#“(stacks_test1)waguirre@waguirre-VirtualBox"”, Indicates that I am in the stacks_test1 environment


#To see what packages are installed in a specific environment:

conda list -n myenv

#If you are already in an active environment, you can see what packages are installed with:

conda list


#To send an environment to someone else, activate the environment:

conda activate environment_name

#Export your environment to a new file:

conda env export > environment_name.yml



####To install packages:

#To see if a specific package is available for installation through Conda:

conda search package_name


#To install a package in a specific environment

conda install –name myenv scipy

#e.g., conda install –name stacks_test1 stacks

#If you do not specify the environment name, the package installs into the current environment


#To install multiple packages at once

conda install package1_name package2_name


#Searched for stacks with regular conda search term and did not find

#went to conda search html site: https://anaconda.org/ #found in bioconda channel. Installed withcommand from site:

conda install -c bioconda stacks


#That worked. However, installed stacks version 1.44! Do not see new version of 2+ stacks


#To remove a package from an environment:

conda remove -n environment_name package_name