Skip to content

Miniconda getting started

phaledang edited this page Dec 26, 2023 · 6 revisions

Basic commands

View version

conda --version

create a new environment is with the following command:

conda create -n <env-name>

To add packages while creating an environment, specify them after the environment name:

conda create -n myenvironment python numpy pandas

list of all your environments:

conda info --envs

change your current environment back to the default base:

conda activate

set environment to active:

conda activate myenvironment

Install package

on current active environment:

conda install matplotlib

via command line option --name myenvironment

conda install --name myenvironment matplotlib

Specifying channels when installing packages

Channels are locations (on your own computer or elsewhere on the Internet) where packages are stored. By default, conda searches for packages in its default channels.

If a package you want is located in another channel, such as conda-forge, you can manually specify the channel when installing the package:

conda install conda-forge::numpy

update conda to the latest version:

conda update conda

Samples

Sample1: new environment name tf with TensorFlow installed

conda create -n tf tensorflow conda activate tf

Sample2: new environment name tf-gpu-cuda9 with tensorflow-gpu cudatoolkit installed

conda create -n tf-gpu-cuda9 tensorflow-gpu cudatoolkit=9.0 conda activate tf-gpu-cuda9

Sources:

https://conda.io/projects/conda/en/latest/user-guide/getting-started.html

https://docs.anaconda.com/free/anaconda/applications/tensorflow/

https://conda.io/projects/conda/en/latest/_downloads/843d9e0198f2a193a3484886fa28163c/conda-cheatsheet.pdf

Clone this wiki locally