使用经验
1. 打包 环境 和 环境中的库
step1:打包环境。
首先激活你的环境
source activate [你的环境名]
导出环境配置
conda env export > environment.yaml # 注:在你想保存.yaml的地方打开终端
到新电脑上创建这个环境
conda env create -f environment.yaml # 正常创建环境是 conda create -n [环境名]
step2:打包环境中的库。
step1:从终端进入到你要保存requirements.txt文件的地址
step2:导出库文件名
pip freeze > requirements.txt
step3:在新环境中安装
pip install -r requirements.txt
2. conda在指定环境下 安装/删除 包
安装
conda install -n [env_name] [tensorflow]
删除
conda remove --n [your_env_name] [package_name] 删除环境中的某个包