ChatGPT解决这个技术问题 Extra ChatGPT

How to reset anaconda root environment

How do I reset the root environment of anaconda? There has to be a simple conda reset command that does this.

I don't want to reinstall anaconda all over again. I have other virtualenvs that I don't want to overwrite and that will happen if I install anaconda again.


L
Leopd

See https://github.com/conda/conda/issues/1032

This has been implemented as conda list --revisions and conda install --rev REV_NUM.

EDIT: be careful though if you execute conda install --rev 0 as this will remove your root environment and the conda command. Maybe conda install --rev 1 would produce the desired behavior (restore root environment to its state after first installation).

EDIT 2018-03-07: Use the --revision argument instead of --rev


@bonobo I think this was a bug and I personally had to reinstall conda from scratch unfortunately (see this conversation). A fix has apparently been merged earlier this year but I would still use this command with caution.
Note: this does not restore or remove packages installed with pip.
@mforbes haha so it does everything but what I actually want. Thanks for the heads-up.
Note the output of conda list --revisions depends on what conda environment is currently active.
this link shriramjaju.page/… explains clearly how to rollback anaconda to a previous state
R
RandyP

One might also consider conda update anaconda. The anaconda meta-package links together certain versions of packages that Continuum Analytics has figured out all play nice together.


That's not resetting the environment at all, no?
I don't understand the downvotes... This approach doesn't reset the environment but it certainly makes it more consistent while still trying to keep it up to date... Given that lack of consistency is usually the main reason for looking after a full reset, then conda update anaconda could work as the least invasive first-aid approach, no?