最近常用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 --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 yourPATH
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
10.克隆已有的環境
conda create --name myclone --clone myenv