conda-env

Standardize conda environment activation and package management for Python workflows.

2|Updated Feb 18, 2026
One-click install
npx skills add https://github.com/MusserLab/lab-claude-skills --skill conda-env
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: conda-env
Source: https://github.com/MusserLab/lab-claude-skills/tree/main/skills/conda-env
Command: npx skills add https://github.com/MusserLab/lab-claude-skills --skill conda-env

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Conda-environment activation can fail or be inconsistent in non-interactive shells, leading to missing packages or mismatched dependencies. This skill standardizes the activation workflow so the correct environment is always active before running Python commands.

Core Features & Use Cases

  • Activation pattern: source the conda setup script (for example, conda.sh) and run conda activate ENV_NAME; supports both Miniconda and Miniforge setups.
  • Before running commands: detect whether an environment exists, list available environments, and activate the required one to ensure reproducibility.
  • Package installation: prefer conda install, fall back to pip inside the active environment, never install into base, and ensure ipykernel is present for notebook execution.
  • One-time configuration: set channel-priority to strict, enable the libmamba solver, and add conda-forge to channels for reliable dependency resolution.
  • Environment export: export environments with conda env export --from-history to capture only user-specified packages for portability.
  • Shared environments and policies: use a consistent naming convention per project and avoid modifying the base environment.

Quick Start

Source the conda setup script and activate ENV_NAME before running your Python commands.

Frequently Asked Questions about conda-env

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I activate a conda environment reliably in a non-interactive shell?

To activate a conda environment reliably in a non-interactive shell, source the conda setup script like conda.sh and run conda activate ENV_NAME to ensure the correct environment is active before executing Python commands.

Why does conda activate fail or show missing packages in automated Python workflows?

Conda activation fails in automated Python workflows when the setup script is not sourced properly, leading to missing packages or mismatched dependencies; standardizing the activation workflow prevents these environment inconsistencies.

What is the best way to export a conda environment for reproducibility?

The best way to export a conda environment for reproducibility is using conda env export --from-history, which captures only user-specified packages to maximize portability across different setups.

Can I use pip to install packages inside a conda environment?

Yes, you can use pip to install packages inside an active conda environment, but you should prefer conda install first and fall back to pip only when necessary, never installing directly into the base environment.

What one-time conda configuration is recommended for reliable dependency resolution?

For reliable dependency resolution, set channel-priority to strict, enable the libmamba solver, and add conda-forge to your channels to ensure consistent and reproducible package management.

How do I ensure ipykernel is present when running notebooks in a conda environment?

To ensure ipykernel is present for notebook execution within a conda environment, explicitly install ipykernel into the active environment during package management to maintain consistent notebook workflows.