Informational: Conda: Keeping Your Conda and Components up to Date

Overview

Keeping your data science environment up to date ensures you have the latest security patches, performance improvements, and feature sets. However, in the world of dependency management, the newest version isn't always compatible.

This article outlines how to update your components safely while minimizing the risk of breaking your existing projects.

Detailed Information

1. Anaconda Navigator (Recommended)

Anaconda Navigator is the desktop graphical user interface (GUI) that allows you to manage packages and environments without typing commands.

  • Automatic Updates: By default, Anaconda will prompt you when a new release is available. If you installed Anaconda using the "Just for me" option, simply follow the onscreen prompts to complete the update.

  • Manual Update (Command Line): If the prompt doesn't appear or you prefer the terminal, you can manually update the Navigator package within your base environment.

conda update --name base anaconda-navigator


2. Conda Package & Environment Manager (Caution)

Updating the conda tool itself is sometimes necessary for compatibility with new packages, but it should be approached with a bit of healthy skepticism.

Warning: Updating the conda package manager can occasionally cause the solver to revert other packages in your environment to older versions to satisfy new dependency requirements. It is not recommended to update the manager mid-project unless a specific package requires a newer version of conda to install.

Pro-Tip: You can reduce the impact of these changes by consistently using unique virtual conda environments for every project rather than installing everything into the base environment.

How to Update

  • Via Navigator GUI:

    1. Open Navigator and go to the Environments tab.
    2. Search for "conda" in the package search bar.
    3. Follow the steps detailed in this Knowledge Base Article.
  • Via Conda Prompt (CLI):

    • To update in the base environment:

    conda update --name base conda

    • To update in a custom environment: (Replace myenvname with your actual environment name)

    conda update --name myenvname conda

3. Updating Individual Packages

If you only need a specific library (like pandas or scikit-learn) to be current, use these methods:

Resources for updating individual packages by method
Update Method Resource Link
Conda Command Line View Conda Instructions
Anaconda Navigator (GUI) View Anaconda Instructions
PIP Command Line View PIP Instructions

4. Entire Environment: Updating All Packages

Updating an entire environment is the "clean sweep" approach. This will attempt to bring every package in the environment to its latest compatible version.

IMPORTANT:

Updating all packages in an environment will automatically install available updates to the conda package manager itself. Please refer to the Conda Package & Environment Manager (Caution) section above before proceeding.

For Additional Assistance

Keeping Anaconda up to Date: https://www.anaconda.com/blog/keeping-anaconda-date

Updating conda to The Current Version: https://docs.conda.io/projects/conda/en/stable/user-guide/tasks/manage-conda.html