Công cụ Developer

Conda Cheat Sheet

Searchable reference for 90+ conda commands — environments, packages, channels, export, mamba, Jupyter kernels, and advanced tips with one-click copy

Setup & Config10Environment Management11Package Installation7Package Management10Export & Sharing7Channels7Info & Diagnostics7Cleanup & Maintenance6Virtual Environments with pip6Conda vs Mamba6Jupyter & Kernels6Advanced & Power Tips10
conda --version

Check conda version

conda update conda

Update conda to latest version

conda update anaconda

Update all packages in Anaconda distribution

conda config --show

Show all conda configuration

conda config --set auto_activate_base false

Disable auto-activation of base environment

conda config --add channels conda-forge

Add conda-forge channel

conda config --show channels

Show configured channels

conda config --set channel_priority strict

Set strict channel priority

conda init bash

Initialize conda for bash shell

conda init powershell

Initialize conda for PowerShell

conda create -n myenv

Create a new empty environment

conda create -n myenv python=3.11

Create environment with specific Python version

conda create -n myenv python=3.11 numpy pandas

Create environment with multiple packages

conda create --clone myenv -n myenv_copy

Clone an existing environment

conda activate myenv

Activate an environment

conda deactivate

Deactivate current environment

conda env list

List all environments

conda info --envs

List all environments (alternative)

conda remove -n myenv --all

Delete an environment completely

conda rename -n old_name new_name

Rename an environment (conda ≥23.9)

conda create -p /path/to/env python=3.11

Create environment at a specific path

conda install numpy

Install a package in active environment

conda install numpy=1.24.0

Install a specific version

conda install -n myenv numpy

Install package into a specific environment

conda install -c conda-forge package

Install from conda-forge channel

conda install --file requirements.txt

Install packages from a requirements file

pip install package

Install a pip package inside conda env

Use when package is not on conda

conda install anaconda::numpy

Install from a specific channel (new syntax)

conda list

List all packages in active environment

conda list -n myenv

List packages in a specific environment

conda list --export > packages.txt

Export package list to a file

conda update numpy

Update a specific package

conda update --all

Update all packages in the environment

conda remove numpy

Remove a package

conda remove -n myenv numpy

Remove a package from a specific environment

conda search numpy

Search for a package

conda search -c conda-forge numpy

Search in conda-forge channel

conda search numpy --info

Show detailed info about a package

conda env export > environment.yml

Export environment to YAML (exact)

conda env export --from-history > env.yml

Export only explicitly installed packages

conda env create -f environment.yml

Create environment from YAML file

conda env update -f environment.yml --prune

Update environment from YAML and remove extras

conda list --export > spec-file.txt

Export spec list (conda only)

conda create -n newenv --file spec-file.txt

Create environment from spec file

conda pack -n myenv -o myenv.tar.gz

Pack environment for offline transfer

Requires conda-pack

conda config --add channels conda-forge

Add conda-forge as a channel

conda config --remove channels defaults

Remove a channel

conda config --show channels

Show current channel list

conda config --set channel_priority strict

Set strict channel priority

conda config --set channel_priority flexible

Set flexible channel priority

conda install -c pytorch pytorch

Install from PyTorch channel

conda install -c nvidia cuda-toolkit

Install from NVIDIA channel

conda info

Show conda system information

conda info --envs

Show environment locations

conda info numpy

Show info about an installed package

conda doctor

Check for environment issues (conda ≥23.3)

conda list --revisions

Show history of changes in environment

conda install --revision 2

Roll back to a specific revision

conda config --describe

Describe all available config options

conda clean --all

Remove all cached packages and tarballs

conda clean --packages

Remove unused cached packages

conda clean --tarballs

Remove cached package tarballs

conda clean --index-cache

Remove cached channel index

conda clean --locks

Remove lock files

conda remove -n myenv --all

Completely remove an environment

conda install pip

Ensure pip is installed in conda env

pip install package

Install a pip-only package

pip list

List pip-installed packages

pip freeze > requirements.txt

Export pip packages to requirements.txt

pip install -r requirements.txt

Install from pip requirements file

conda list | grep pypi

Show packages installed via pip

pypi channel indicates pip-installed

conda install -c conda-forge mamba

Install mamba (faster conda)

mamba create -n myenv python=3.11

Create environment with mamba

mamba install numpy pandas

Install packages with mamba (faster)

mamba update --all

Update all packages with mamba

mamba env export > environment.yml

Export environment with mamba

mamba clean --all

Clean cache with mamba

conda install jupyterlab

Install JupyterLab

conda install ipykernel

Install IPython kernel

python -m ipykernel install --user --name myenv

Register conda env as Jupyter kernel

jupyter kernelspec list

List all Jupyter kernels

jupyter kernelspec uninstall myenv

Remove a Jupyter kernel

jupyter lab

Launch JupyterLab

conda create -n myenv --offline

Create environment using only cached packages

conda install --freeze-installed numpy

Install without changing existing packages

conda config --env --add channels conda-forge

Add channel for current env only

CONDA_SUBDIR=osx-arm64 conda create -n arm_env

Create environment for a specific platform

conda run -n myenv python script.py

Run a command in an env without activating

conda compare environment.yml

Compare env with a YAML file (conda ≥23.1)

conda env config vars set MY_VAR=value

Set environment variable in conda env

conda env config vars list

List env variables set in conda env

conda build recipe/

Build a conda package from a recipe

Requires conda-build

conda convert --platform all pkg.tar.bz2

Convert package to all platforms

Requires conda-build

93 conda commands · hover any command to copy

Chưa thấy công cụ bạn cần?

Chúng tôi xây công cụ miễn phí dựa trên phản hồi cộng đồng. Hãy đề xuất tiện ích giúp workflow của bạn!

Conda Cheat Sheet — Free Tool Online | FreeTool24 | FreeTool24