I want to dynamically store in the project directory, how can I do that? I have searching and found this Can I choose where my conda environment is stored? but this not dynamically store my conda environment to the project directory like virtualenv do
Asked
Active
Viewed 4,716 times
1 Answers
5
Use --prefix, -p
for conda create
instead of --name, -n
.
$ conda create --help
...
Target Environment Specification:
-n ENVIRONMENT, --name ENVIRONMENT
Name of environment.
-p PATH, --prefix PATH
Full path to environment location (i.e. prefix).
...
Usage
conda create -p ./venv python=3.6
conda env list
# activate the local environment with relative or absolute path
conda activate ./venv
conda deactivate
# remove the env
conda env remove -p ./venv
# or just delete the "venv" folder directly
Note: When you set a specific path for your environment with -p
, -n
is not allowed, which means you cannot give the env a name in this case. You have to operate this kind of envs with their paths.

Simba
- 23,537
- 7
- 64
- 76