Daren Thomas
Daren Thomas

Reputation: 70314

Does `conda env update` remove packages that aren't part of the environment file?

The documentation for conda env update does not really answer this question: After executing the command, is the environment now the same as described in the -f FILE yaml file or does it just add non-existent packages and upgrade outdated packages, leaving manually installed packages?

Upvotes: 6

Views: 4296

Answers (1)

Adonis
Adonis

Reputation: 4818

The --prune option of conda env update is what you are looking for:

conda env update -f file.yml --prune

The option is mentioned in the documentation

Edit: As @MarkLoyman mentions, it had issues since conda 4.4 (GitHub issue), but has been fixed since conda 23.9.0 (GitHub pull request).

Upvotes: 7

Related Questions