Conda Cheatsheet¶
Command line package and environment manager Learn to use conda in 30 minutes at bit.ly/tryconda
Getting Started¶
Setting up Conda on your machine¶
When using tllihpcmind6
, initialize Conda by source ~/.bashrc
1 2 3 4 5 6 7 8 9 10 11 12 |
|
Creating a Virtual Environment¶
A virtual environment can be defined and created through an environment.yml
file. For example, the Conda environment conda-env-cdm
can be created with this snippet included in environment.yml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
Conda Basics¶
conda info
: Verify conda is installed, check version numberconda update conda
: Update conda to the current versionconda install PACKAGENAME
: Install a package included in Anacondaspyder
: Run a package after install, example Spyder*conda update PACKAGENAME
: Update any installed programCOMMANDNAME --help
: Command line helpconda install --help
Using Environments¶
conda create --name py35 python=3.5
: Create a new environment named py35, install Python 3.5conda env create -f environment.yaml
: Create a new environment with specifications inenvironment.yaml
(See Start-up)conda activate py35
: Activate the new environment to use itconda env list
: Get a list of all my environments, active environment is shown with *conda list
: List all packages and versions installed in active environmentconda env remove --name bio-env
: Delete an environment and everything in itconda deactivate
: Deactivate the current environment
Installing Packages¶
Anaconda includes both the Python and R programming languages, most of the common Python libraries used in science and engineering (including NumPy, SciPy, Matplotlib, and pandas), and many commonly used R packages (https://anaconda.org/).
conda install -c anaconda pandas
: Install Pandas into your activate environment