markdown CONDA ENV

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown CONDA ENV相关的知识,希望对你有一定的参考价值。

To create an environment:
```shell
conda create --name myenv
conda create -n myenv python=3.4
conda create -n myenv scipy
conda create -n myenv python=3.4 scipy=0.15.0 astroid babel
```

Create the environment from the environment.yml file:
```shell
conda env create -f environment.yml
```

Sharing an environment
```shell
conda env export > environment.yml
```

Updating an environment
```shell
conda env update --prefix ./env --file environment.yml  --prune
```

Cloning an environment
```shell
conda create --name myclone --clone myenv
```

Building identical conda environments
```shell
conda list --explicit > spec-file.txt
### run on another machine
conda create --name myenv --file spec-file.txt
```

Other
```shell
conda info --envs
## deactivate env
conda deactivate
## remove
conda remove --name myenv --all
```

Saving environment variables
1. Locate the directory for the conda environment in your Anaconda Prompt by running in the command shell %CONDA_PREFIX%.
2. Enter that directory and create these subdirectories and files:
```shell
cd %CONDA_PREFIX%
mkdir .\etc\conda\activate.d
mkdir .\etc\conda\deactivate.d
type NUL > .\etc\conda\activate.d\env_vars.bat
type NUL > .\etc\conda\deactivate.d\env_vars.bat
```
3. Edit .\etc\conda\activate.d\env_vars.bat as follows:
```shell
set MY_KEY='secret-key-value'
set MY_FILE=C:\path\to\my\file
```
4. Edit .\etc\conda\deactivate.d\env_vars.bat as follows:
```shell
set MY_KEY=
set MY_FILE=
```
When you run conda activate analytics, the environment variables MY_KEY and MY_FILE are set to the values you wrote into the file. When you run conda deactivate, those variables are erased.

以上是关于markdown CONDA ENV的主要内容,如果未能解决你的问题,请参考以下文章

conda环境移植

text 创建一个conda env并安装gradupwarp

Conda new env 在 mac 中使用了非 conda python

conda env 无法创建新环境

linux中conda虚拟环境使用(便于项目切换)pip和conda换源

conda env create 退出并验证交易:/被杀死