Can I choose where my conda environment is stored?

前端 未结 3 493
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-13 04:17

Can I change the path /Users/nolan/miniconda/envs/ to another one when creating a virtual environment ? I\'d like it to be specific to my project directory. (As we can do wi

3条回答
  •  爱一瞬间的悲伤
    2020-12-13 04:46

    If you would like it to be relative to your project directory, use the --prefix flag: https://conda.io/docs/commands/env/conda-env-create.html?highlight=prefix

    For example, if you use environment.yml files to define your environment and you want your environment to be created in the venv directory of your project you would use the following:

    conda env create -f environment.yml --prefix venv

    The conda create command also has the --prefix flag as well: https://conda.io/docs/commands/conda-create.html?highlight=prefix

    I don't know if this was available as of the original posting, but it should be available as of Liu Sha's comment, and gets closer to answering the question in regards to "I'd like it to be specific to my project directory".

提交回复
热议问题