C.W.K.
Stream
Lesson 05 of 05 · published

conda Wisdom

~10 min · conda, wisdom, production

Level 0Newbie
0 XP0/55 lessons0/16 achievements
0/80 XP to next level80 XP to go0% complete

conda is the most-misunderstood package manager in this quest because it grew up in a non-web-developer world. These rules cross the cultural gap.

Use Miniconda or Miniforge, not Anaconda. The full Anaconda distribution is 3 GB of pre-installed scientific stuff most people never touch. Install conda; install what you need.

Set conda-forge as default channel. More packages, more recent versions, no commercial licensing strings.

One env per project. Same rule as venv — never install into the base env. conda activate per project; commit environment.yml to the repo.

Use --from-history when exporting envs to share. The default export pins exact build hashes which often don't exist on different platforms; --from-history exports your intent (just what you asked for), and conda re-resolves on the target machine.

For new Python projects, consider pixi. pixi (next track) is conda-forge compatible but 10x faster, with native lock files. It's 'conda done right' for projects where you'd otherwise reach for conda but want better DX.

Don't fight the slow base env. If conda update or conda install in the base env is sluggish, that's expected — base envs accumulate. Create per-project envs and let base be light.

Code

direnv hook for auto-activation·bash
# Install direnv
brew install direnv
echo 'eval "$(direnv hook zsh)"' >> ~/.zprofile

# In a project's .envrc
echo 'eval "$(conda shell.bash hook)"' > .envrc
echo 'conda activate myenv' >> .envrc
direnv allow

# cd into the project, env auto-activates.
# This is what Pippa uses for the cwk-pippa env.

External links

Exercise

List your current conda envs ('conda env list'). For each, write down: what project uses it, when was it last touched. Anything older than 6 months and unused → 'conda remove --name X --all'. Reclaim the disk; reduce maintenance surface.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.