556👍
Try using conda env update:
conda activate myenv
conda env update --file local.yml --prune
--prune
uninstalls dependencies which were removed from local.yml
, as pointed out in this answer by @Blink.
Attention: if there is a name
tag with a name other than that of your environment in local.yml
, the command above will create a new environment with that name. To avoid this, use (thanks @NumesSanguis):
conda env update --name myenv --file local.yml --prune
See Updating an environment in Conda User Guide.
80👍
The suggested answer is partially correct. You’ll need to add the –prune option to also uninstall packages that were removed from the environment.yml.
Correct command:
conda env update -f local.yml --prune
- [Django]-Annotate a queryset with the average date difference? (django)
- [Django]-Complete django DB reset
- [Django]-Get count of related model efficiently in Django
35👍
alkamid’s answer is on the right lines, but I have found that Conda fails to install new dependencies if the environment is already active. Deactivating the environment first resolves this:
source deactivate;
conda env update -f whatever.yml;
source activate my_environment_name; # Must be AFTER the conda env update line!
- [Django]-How to make two django projects share the same database
- [Django]-Django 2 – How to register a user using email confirmation and CBVs?
- [Django]-How to change User representation in Django Admin when used as Foreign Key?
1👍
Recently Conda introduced the option to stack environments, which should solve this problem.
- [Django]-Filtering dropdown values in django admin
- [Django]-Multiple annotate Sum terms yields inflated answer
- [Django]-Django – {% csrf_token %} was used in a template, but the context did not provide the value