conda infoVersion, config, envs dir, package cache dir. First thing to run.★conda init bashWireconda activateinto your shell rc. Alsozsh,fish,powershell. Restart the shell after.conda update -n base condaUpdate conda itself. It lives inbase— nothing else should.conda config --set auto_activate_base falseStop auto-activatingbasein every new terminal.conda COMMAND --helpEvery subcommand documents its own flags.
conda create -n myenv python=3.12The default move. Pin Python at creation — changing it later triggers a full re-solve.★conda create -n myenv python=3.12 numpy pandasName everything up front: one solve beats five.★conda create -p ./.venv python=3.12-pputs the env in a project folder instead of the shared envs dir.conda create --clone myenv -n myenv-expCopy an env before a risky change. Cheap — it re-uses the cache.conda rename -n old newRename in place (clone + remove under the hood).conda remove -n myenv --allDelete an entire environment.destructive
conda activate myenvPrepends the env'sbin/toPATH. Prompt shows(myenv).★conda deactivatePop back one level. Repeat to leavebase.conda env listAll envs + paths.*marks the active one. Same asconda info --envs.★conda run -n myenv python app.pyRun one command inside an env without activating — ideal for cron, Make, CI.conda env config vars set KEY=val -n myenvEnv vars that set on activate and unset on deactivate.
conda install numpy pandasDependencies and platform binaries are resolved for you.★conda install -c conda-forge polarsPull from a named channel for this command only.★conda install conda-forge::polarsIdentical, inline form. Handy when channels differ per package.conda install -n myenv scipyTarget another env without activating it.conda install scipy --yesSkip the confirm prompt. Required in scripts & Dockerfiles.conda install scipy --dry-runShow the solve result and change nothing.conda install ./pkg.condaOffline, from a local file. Does not resolve dependencies.
conda install numpy=1.26Fuzzy. One=means1.26.*— any patch.★conda install numpy==1.26.4Exact. Two==pins that release precisely.conda install "numpy>=1.24,<2"AND. Quote it — the shell eats<>*|.★conda install "numpy=1.24|1.26"OR — either minor line is acceptable.conda install "pytorch=2.*=cuda*"Third field is the build string — how it was compiled (CUDA vs CPU, Python ABI).conda install "pkg[version='>=1.2',build=py311*]"Bracket form: same grammar, explicit keys.
conda listEverything in the active env, with versions.★conda list --show-channel-urlsWhich channel each package came from. The first thing to check when an env misbehaves.★conda list ^scikitThe positional arg is a regex filter.conda search polarsAll versions/builds available in your channels.conda search polars --infoDependencies, license, md5, per build.conda repoquery depends scipyWhat scipy needs.conda repoquery whoneeds numpyReverse: what would break if numpy moved.
conda update numpyHighest version within the same major. Conservative.conda install numpyHighest version, period. Use this to cross a major boundary.conda update --allRe-solve the whole env. Do it on a clone first.conda remove numpyUninstall from active env.conda uninstallis an alias.conda remove -n myenv numpyRemove from a specific env.
conda config --show-sourcesEvery config file in play and what it sets. Start debugging here.★conda config --add channels conda-forgePrepend → highest priority.--appendputs it last instead.conda config --set channel_priority strictDon't let the solver mix channels for the same package. Strongly recommended.★conda config --show channel_priorityConfirm which mode is actually active.conda install -c conda-forge --override-channels pkgIgnore configured channels entirely for this solve.conda config --remove channels defaultsCommit to one ecosystem. Mixingdefaults+conda-forgeis the classic breakage.
conda env export --from-history > environment.ymlPortable. Only what you explicitly asked for → re-solves on any OS. Omits pip packages.★conda env export > environment.ymlFull transitive tree with builds. Faithful, but usually not portable across OSes.conda list --explicit > spec.txtLockfile. Exact URLs, no solve on restore. Same-platform only.★conda export --format=environment-yamlNewer unified exporter. Alsoenvironment-json,explicit,requirements.conda export --file=environment.yamlFormat inferred from the filename.
conda env create -f environment.ymlBuild the env from YAML. Name comes from the file.★conda env create -f environment.yml -n otherOverride the name in the file.conda create -n myenv --file spec.txtRestore from an explicit lockfile — no solve, near-instant. Since conda 26.3,--filealso acceptsenvironment.yamlandrequirements.txt.conda env update -f environment.yml --pruneSync an existing env to the file.--prunedrops what's no longer listed.★conda compare environment.ymlDiff the active env against a spec file before you act.
conda install pipInstall pip into the env, sopipisn't the base/system one.python -m pip install some-pypi-only-pkgUnambiguous — uses the active env's interpreter.★conda install anything # after pipConda can't see pip's files and may overwrite them. Rebuild the env instead.breaks envsconda list --show-channel-urlspip-installed packages show aspypi— that's your audit.
conda list --revisionsEvery transaction on this env, numbered. Conda's answer togit log.★conda install --revision 3Roll the env back to that state.★conda doctorHealth check: missing files, altered files, integrity problems.conda doctor --fixApply fixes for the problems it finds, not just report them.--fixadded in conda 26.1.★conda clean --index-cacheFixes stale-repodata weirdness after adding a channel.
conda clean --all --dry-runPreview the reclaim first. Always.conda clean --allDrop unused tarballs, unused packages, index cache. Existing envs are hard-linked and stay intact.★conda clean --tarballsJust the downloaded archives — the biggest, safest win.conda info --envs --sizeDisk usage per env — find the bloated ones before you clean.--size(conda 26.1) also works onconda env listandconda list.★conda config --set solver libmambaThe fast C++ solver. Default since conda 23.10 — verify withconda config --show solver.mamba install pkgDrop-in, same flags, same.condarc.micromambais a single static binary — ideal for CI.
-n myenv--name. Lives in the shared envs dir; shows up inconda env list.-p ./.venv--prefix. Any path. Project-local, ships with the repo, but not listed by name.(omitted)Acts on the currently active env — which may bebase. Check your prompt first.conda config --set env_prompt '({name})'Keeps the prompt short for-penvs instead of printing the whole path.