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
conda create -p env-dir
is the possible solution which i used where venv, virtualenv and even pipenv failed as I used berrycomda on my raspberrypi
You can change the environments directory by editing your .condarc file found in your user directory. Add the following specifying the path to the directory you want:
envs_dirs:
- /Users/nolan/newpath
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".