anaconda 环境管理

版权声明: https://blog.csdn.net/ninnyyan/article/details/83619738

最近常用anaconda来管理环境,一些比较常用的如下

1.使用命令行安装(版本可更改)

1)download the .sh file first: wget https://repo.continuum.io/archive/Anaconda3-4.4.0-Linux-x86_64.sh
2)bash file_name

2.新建一个干净的conda环境

conda create env --name myenv_name

用现有的yml文件创建

conda env create -f environment.yml

3.导出当前环境到某个yml文件

conda env export > environment_demo.yml

4.卸载anaconda

rm -rf ~/anaconda
rm -rf ~/.anaconda/navigator
rm -rf ~/.condarc ~/.conda ~/.continuum
nano ~/.bash_profile # remove the anaconda directory from your PATH env var
remove the shortcut from the applications folder

5.一个问题的解决办法
cannot find conda command after instaling

export PATH=~/anaconda3/bin:$PATH(等号左右不要加空格)

6.删除一个conda环境

conda remove --name myenv --all

7.使用conda安装指定版本的包,例如安装0.19.2版本的sklearn

conda install scikit-learn=0.19.2

8.使用conda卸载已经安装的包

conda uninstall pkg_name

9.查看所有已经安装的包

conda list

猜你喜欢

转载自blog.csdn.net/ninnyyan/article/details/83619738