4

When creating conda virtual environment with YAML file for the first time, I unknowingly ran:

conda env update -f environment.yml
call activate process_name

which successfully created a venv in: C:\Users\userName\AppData\Local\Continuum\anaconda3\envs.

Should I have ran the following instead?

conda env create -f environment.yml
call activate process_name

Does conda env update create a new venv if no existing venv is found in the anaconda envs directory?

How stable is conda env update in defaulting to creating a new venv if no existing venv is found?

2 Answers 2

0

Both should work to create the new venv if such an environment doesn't exists. You can easily try this with a sample environment.yml

Create the following environment.yml file in a directory of your choice:

name: testenv123
dependencies:
  - python
  - pytorch

and then run this:

conda env update
activate testenv123
0

Does conda env update create a new venv if no existing venv is found in the anaconda envs directory?

Yes

How stable is conda env update in defaulting to creating a new venv if no existing venv is found?

I could not find any documentation stating that it will create a new environment if the environment does not already exist. Therefore I think that there are no guarantees about this behavior staying the same in the future.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.