How to update anaconda
How to update anaconda
Как обновить Анаконду: пошаговая инструкция с картинками для вас
если на Windows, тогда откройте меню «Пуск» и найдите пункт Anaconda Prompt;
если вы используете MacOS или Linux, тогда просто откройте Терминал.
conda update conda
conda install anaconda=Здесь пиш е те номер версии, до которой нужно обновить Анаконду.
Как обновить Анаконду: несколько рекомендаций
Еще обновить Анаконду можно командой:
Но эта команда применяется для более точечного обновления и обновляет пакеты только в текущей среде, в д ру гих средах пакеты не будут обновлены. Иногда нужно обновить не все пакеты, а только в одной конкретной среде, тогда вы можете применить эту же команду, но немного модифицировав ее и указав имя конкретной среды, которую хотите обновить. Например:
Как обновить Анаконду, если через Терминал неудобно
Там же в Навигаторе ценой пары кликов вы сможете обновить свою Анаконду целиком или выбирая отдельные пакеты для обновления.
Нужно ли обновление Анаконды
это не нарушит работу вашего кода, над которым вы трудились долгое время;
Заключение
нужно ли вам обновлять весь дистрибутив;
или нужно обновить отдельный его пакет.
Но самое важное — это перед обновлением оценить возможные риски, чтобы обновление не принесло вам больше проблем, чем пользы.
Мы будем очень благодарны
если под понравившемся материалом Вы нажмёте одну из кнопок социальных сетей и поделитесь с друзьями.
Keeping Anaconda Up To Date
Aug 15, 2017
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.»
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.
Or from the command line:
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:
The conda documentation has more details and examples.
pip, PyPI, and setuptools?
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:
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 Enterprise can help you and your colleagues with collaboration, security, governance, and provenance around your data science workflows.
What is the right way to update Anaconda and Conda base & environments?
Just wondering as what is the right way to update Anaconda and Conda installation and virtual environments. Here is my confusion step by step:
Lastly, just to make sure that everything’s updated, I ran conda update anaconda again. I was expecting a message like Everything’s up to date but to my surprise it was again showing a huge list of packages that needed to be updated/downgraded again?
What am I doing wrong here? It appears to me as if I am going in circles with these commands. Any help?
4 Answers 4
Trending sort
Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.
It falls back to sorting by highest score if no posts are trending.
Switch to Trending sort
Update Anaconda
Update All
It may be worth noting that people who prioritize having access to the latest versions of packages often seem to prefer Conda Forge, because it tends to have more frequent package releases. However, in my opinion, there’s almost no point to installing Anaconda if you’re going to switch most packages to Conda Forge anyway. Instead, just install Miniconda and only install what you want from Conda Forge at the start.
Update None
Personally, I will rarely run conda update on an env once I’ve harden the requirements for a project. Every time you update an env, you risk breaking code that you’ve already written. Instead, Conda makes it quite easy to create new envs, and if they have a lot of overlap with other envs, then the envs can be quite light due to sharing packages across envs via hardlinking.
Update Conda
The one exception to everything above is the conda package, which is the very infrastructure you’re using to manage packages and envs. That, one should update just like any other package manager (e.g., a pip or a homebrew ).
Found the answers in this useful post by Anaconda
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:
Or from the command line:
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:
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 update пѓЃ
Updates conda packages to the latest compatible version.
This command accepts a list of package names and updates them to the latest versions that are compatible with all other packages in the environment.
Positional ArgumentsпѓЃ
Packages to install or update in the conda environment.
Named ArgumentsпѓЃ
Target Environment SpecificationпѓЃ
Name of environment.
Full path to environment location (i.e. prefix).
Channel CustomizationпѓЃ
Use locally built packages. Identical to ‘-c local’.
Specify name of repodata on remote server. Conda will try whatever you specify, but will ultimately fall back to repodata.json if your specs are not satisfiable with what you specify here. This is used to employ repodata that is reduced in time scope. You may pass this flag more than once. Leftmost entries are tried first, and the fallback to repodata.json is added for you automatically.
Solver Mode ModifiersпѓЃ
Packages in lower priority channels are not considered if a package with the same name appears in a higher priority channel.
Do not install, update, remove, or change dependencies. This WILL lead to broken environments and inconsistent behavior. Use at your own risk.
Only install dependencies.
Ignore pinned file.
Possible choices: classic, libmamba, libmamba-draft
EXPERIMENTAL. Choose which solver backend to use.
Ensure that any user-requested package for the current operation is uninstalled and reinstalled, even if that package already exists in the environment.
Do not update or change already-installed dependencies.
Exit early and do not run the solver if the requested specs are satisfied. Also skips aggressive updates as configured by ‘aggressive_update_packages’. Similar to the default behavior of ‘pip install’.
Update all installed packages in the environment.
Update based on provided specifications.
Package Linking and Install-time OptionsпѓЃ
Install all packages using copies instead of hard- or soft-linking.
Allow clobbering of overlapping file paths within packages, and suppress related warnings.
Networking OptionsпѓЃ
Use cache of channel index files, even if it has expired.
Allow conda to perform «insecure» SSL connections and transfers. Equivalent to setting ‘ssl_verify’ to ‘false’.
Offline mode. Don’t connect to the Internet.
Output, Prompt, and Flow Control OptionsпѓЃ
Only display what would have been done.
Report all output as json. Suitable for using conda programmatically.
Do not display progress bar.
Can be used multiple times. Once for INFO, twice for DEBUG, three times for TRACE.
Do not ask for confirmation.
Solve an environment and ensure package caches are populated, but exit prior to unlinking and linking packages into the prefix.
How do I update Anaconda?
13 Answers 13
Trending sort
Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.
It falls back to sorting by highest score if no posts are trending.
Switch to Trending sort
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 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 base environment, selecting «Open Terminal»:
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:
Or from the command line:
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 base 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 then create a conda environment to hold them. Thanks to the conda package cache and the way file linking is used doing this is typically i) fast and ii) consumes very little additional disk space. E.g.
The conda documentation has more details and examples.
pip, PyPI, and setuptools?
Commercial use of Anaconda or Anaconda Enterprise
It is pretty much exactly the same story, with the exception that you may not be able to update the base 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:
If you are trying to update your Anaconda version to a new one, you’ll notice that running the new installer wouldn’t work, as it complains the installation directory is non-empty.
So you should use conda to upgrade as detailed by the official docs:
In Windows, if you made a «for all users» installation, it might be necessary to run from an Anaconda prompt with Administrator privileges.
This prevents the error:
ERROR conda.core.link:_execute(502): An error occurred while uninstalling package ‘defaults::conda-4.5.4-py36_0’. PermissionError(13, ‘Access is denied’)
Open «command or conda prompt» and run:
It’s a good idea to run both command twice (one after the other) to be sure that all the basic files are updated.
This should put you back on the latest ‘releases’, which contains packages that are selected by the people at Continuum to work well together.
If you want the last version of each package run (this can lead to an unstable environment):
Hope this helps.
Sources:
You can find the current and past version codes here.
The command will update to a specific release of the Anaconda meta-package.
Open Anaconda cmd in base mode:
Then use conda update conda to update Anaconda.
Here’s the best practice (in my humble experience). Selecting these four packages will also update all other dependencies to the appropriate versions that will help you keep your environment consistent. The latter is a common problem others have expressed in earlier responses. This solution doesn’t need the terminal.
If you have trouble to get e.g. from 3.3.x to 4.x (conda update conda «does not work» to get to the next version) than try it more specific like so:
You should know what you do, because conda could break due to the forced installation. If you would like to get more flexibility/security you could use pkg-manager like nix(-pkgs) [with nix-shell] / NixOS.
Yet, another answer:
I’m using Windows 10. The following updates everything and also installs some new packages, including a Python update (for me it was 3.7.3).
At the shell, try the following (be sure to change where your Anaconda 3 Data is installed). It takes some time to update everything.
To update your installed version to the latest version, say 2019.07, run:
In most cases, this method can meet your needs and avoid dependency problems.
Intro
This answer wraps up many answers and comments, it does not add new code, all credits go to the other answers, especially this answer that shows how to install the official release, fully in line with the docs.
In the following, the «docs» mean the official Anaconda documentation at Updating from older versions. It makes sense to read the docs, it is a short overview.
And since it will be used quite often, here is the definition of metapackage:
A metapackage is a very simple package that has at least a name and a version. It need not have any dependencies or build steps. Metapackages may list dependencies to several core, low-level libraries and may contain links to software files that are automatically downloaded when executed.
First step
As a first step before the anaconda install, you update conda:
Second step
1. Custom metapackage
If you are allowed to have the most recent custom metapackage (mind that this might not always be the best choice for standard packages with constrained dependencies), then you can use
There is a special “custom” version of the Anaconda metapackage that has all the package dependencies, but none of them are constrained. The “custom” version is lower in version ordering than any actual release number.
update leads to more installation steps than install
install leads to less installation steps than update :
2. Official metapackage (= release)
In the following code snippets, update and install lead to the same results. I use install like in the docs.
If you do not want to install a custom version of the metapackage but rather need the most recent official release, install with
Find the VersionNumber
At the time of writing, in 09/2021, the latest available release (Anaconda individual edition) is
Thus, something like the 2021.05 version code is the latest release shortcut that you need to find. You can also find the full version name of your OS like for example Anaconda3-2021.05-Windows-x86_64.exe in the list of available Anaconda versions that is directly linked in the docs. It is sorted by name and date, thus, you need to search for the year like «YYYY-MM» / «YYYY-» or scroll through the whole list to find the most recent versions:
For the example of Windows 10 64 bit, the command could as well be:
If you install a release after having installed the most recent custom metapackage, you will see some packages to be removed and quite many to be downgraded slightly. This is because the release is slightly back in time, but therefore also fully trusted.
As to the docs (last sentence of the following quote below), installing the custom (= most recent) metapackage of 2019.07 can be done as well by running
and if you have virtual environments, you need:
Result: Which to install: official or custom metapackage?
This is also the way to update Spyder:
Small «proof»: I used conda update conda at first, and after that, conda update anaconda had nothing to do anymore, conda update conda had done all or the tasks.
That again sounds as if both commands are made the same now, perhaps they have not been the same only in the past.
The choice is up to you, it depends on how urgently you need to be up-to-date with some packages. Just start the installer to see what would happen, you can still enter n to cancel the installation. I am going to take