- Keeping Anaconda Up To Date
- The Answer
- What 95% of People Actually Want
- Update Individual Packages
- Updating Just the Packages in the Standard Anaconda Distribution
- Why Updating the Anaconda Package is Almost Always a Bad Idea
- Leverage conda Environments
- pip, PyPI, and setuptools?
- Commercial Use of Anaconda or Anaconda Enterprise
- Where to Go Next
- Command reference
- Conda vs. pip vs. virtualenv commands
Keeping Anaconda Up To Date
Below is a question that gets asked so often that I decided it would be helpful to publish an answer explaining the various ways in which Anaconda can be kept up to date. The question was originally asked on StackOverflow.
I have Anaconda installed on my computer and I’d like to update it. In Navigator I can see that there are several individual packages that can be updated, but also an anaconda package that sometimes has a version number and sometimes says custom. How do I proceed?
The Answer
What 95% of People Actually Want
In most cases what you want to do when you say that you want to update Anaconda is to execute the command:
This will update all packages in the current environment to the latest version—with the small print being that it may use an older version of some packages in order to satisfy dependency constraints (often this won’t be necessary and when it is necessary the package plan solver will do its best to minimize the impact).
This needs to be executed from the command line, and the best way to get there is from Anaconda Navigator, then the “Environments” tab, then click on the triangle beside the root environment, selecting “Open Terminal.”
This operation will only update the one selected environment (in this case, the root environment). If you have other environments you’d like to update you can repeat the process above, but first click on the environment. When it is selected there is a triangular marker on the right (see image above, step 3). Or, from the command line, you can provide the environment name ( -n envname ) or path ( -p /path/to/env ). For example, to update your dspyr environment from the screenshot above:
Update Individual Packages
If you are only interested in updating an individual package then simply click on the blue arrow or blue version number in Navigator, e.g. for astroid or astropy in the screenshot above, and this will tag those packages for an upgrade. When you are done you need to click the “Apply” button.
conda update astroid astropy
Updating Just the Packages in the Standard Anaconda Distribution
If you don’t care about package versions and just want “the latest set of all packages in the standard Anaconda Distribution, so long as they work together,” then you should take a look at this gist.
Why Updating the Anaconda Package is Almost Always a Bad Idea
In most cases, updating the Anaconda package in the package list will have a surprising result—you may actually downgrade many packages (in fact, this is likely if it indicates the version as custom ). The gist above provides details.
Leverage conda Environments
Your root environment is probably not a good place to try and manage an exact set of packages—it is going to be a dynamic working space with new packages installed and packages randomly updated. If you need an exact set of packages, create a conda environment to hold them. Thanks to the conda package cache and the way file linking is used, doing this is typically fast and consumes very little additional disk space. For example:
conda create -n myspecialenv -c bioconda -c conda-forge python=3.5 pandas beautifulsoup seaborn nltk
The conda documentation has more details and examples.
pip, PyPI, and setuptools?
None of this is going to help with updating packages that have been installed from PyPI via pip , or any packages installed using python setup.py install . conda list will give you some hints about the pip-based Python packages you have in an environment, but it won’t do anything special to update them.
Commercial Use of Anaconda or Anaconda Enterprise
It’s pretty much exactly the same story, with the exception that you may not be able to update the root environment if it was installed by someone else (say, to /opt/anaconda/latest ). If you’re not able to update the environments you are using, you should be able to clone and then update:
conda create -n myenv --clone root conda update -n myenv --all
Where to Go Next
If you have more questions about Anaconda then you can refer to our online documentation, or make use of our commercial (paid) or community (free) support channels. If you are using Anaconda in an enterprise setting, then I think you’ll be interested in learning about how Anaconda can help you and your colleagues with collaboration, security, governance, and provenance around your data science workflows.
Command reference
Conda provides many commands for managing packages and environments. The links on this page provide help for each command. You can also access help from the command line with the —help flag:
The following commands are part of conda:
- conda clean
- Removal Targets
- Output, Prompt, and Flow Control Options
- Positional Arguments
- Output, Prompt, and Flow Control Options
- Target Environment Specification
- Output, Prompt, and Flow Control Options
- Config File Location Selection
- Config Subcommands
- Config Modifiers
- Positional Arguments
- options
- Target Environment Specification
- Channel Customization
- Solver Mode Modifiers
- Package Linking and Install-time Options
- Networking Options
- Output, Prompt, and Flow Control Options
- options
- Target Environment Specification
- Positional Arguments
- options
- Output, Prompt, and Flow Control Options
- Positional Arguments
- options
- setup type
- Output, Prompt, and Flow Control Options
- Positional Arguments
- options
- Target Environment Specification
- Channel Customization
- Solver Mode Modifiers
- Package Linking and Install-time Options
- Networking Options
- Output, Prompt, and Flow Control Options
- Positional Arguments
- options
- Target Environment Specification
- Output, Prompt, and Flow Control Options
- Channel Customization
- options
- Target Environment Specification
- Positional Arguments
- options
- Target Environment Specification
- Channel Customization
- Solver Mode Modifiers
- Networking Options
- Output, Prompt, and Flow Control Options
- Positional Arguments
- options
- Target Environment Specification
- Positional Arguments
- options
- Target Environment Specification
- options
- Channel Customization
- Networking Options
- Output, Prompt, and Flow Control Options
- Positional Arguments
- options
- Target Environment Specification
- Channel Customization
- Solver Mode Modifiers
- Package Linking and Install-time Options
- Networking Options
- Output, Prompt, and Flow Control Options
Conda vs. pip vs. virtualenv commands
If you have used pip and virtualenv in the past, you can use conda to perform all of the same operations. Pip is a package manager and virtualenv is an environment manager. conda is both.
Scroll to the right to see the entire table.
Conda package and environment manager command
Pip package manager command
Virtualenv environment manager command
conda install $PACKAGE_NAME
conda update —name $ENVIRONMENT_NAME $PACKAGE_NAME
pip install —upgrade $PACKAGE_NAME
Linux/macOS: pip install -U pip Win: python -m pip install -U pip
conda remove —name $ENVIRONMENT_NAME $PACKAGE_NAME
pip uninstall $PACKAGE_NAME
conda create —name $ENVIRONMENT_NAME python
cd $ENV_BASE_DIR; virtualenv $ENVIRONMENT_NAME
conda activate $ENVIRONMENT_NAME *
Deactivate an environment
Search available packages
Install package from specific source
conda install —channel $URL $PACKAGE_NAME
pip install —index-url $URL $PACKAGE_NAME
conda list —name $ENVIRONMENT_NAME
Install virtualenv wrapper, then lsvirtualenv
Install other package manager
* conda activate only works on conda 4.6 and later versions. For conda versions prior to 4.6, type:
* conda update python updates to the most recent in the series, so any Python 2.x would update to the latest 2.x and any Python 3.x to the latest 3.x.
© Copyright 2017, Anaconda, Inc. Revision 08c0ab8a .