安装anaconda

安装包网址:https://repo.continuum.io/archive/

https://docs.conda.io/en/latest/miniconda.html

下载:$ wget -c https://repo.continuum.io/archive/Anaconda3-2019.03-Linux-x86_64.sh

权限:

$ chmod 777 Anaconda3-2019.03-Linux-x86_64.sh

安装:

$ bash Anaconda3-2019.03-Linux-x86_64.sh

$ cd anaconda3/bin

$ chmod 777 activate

进入环境:

$ source ./activate

当命令行前面出现(base)的时候说明现在已经在conda的环境中了。这时候输入conda list 命令就有反应了

添加官方channel:

(base) helin@helin:~$ conda config --add channels bioconda

(base) helin@helin:~$ conda config --add channels conda-forge

退出环境:

(base) helin@helin:~$ source anaconda3/bin/deactivate

环境中打开notebook(只能在默认的bash环境打开):

(base) helin@helin:~$ ipython notebook

创建新环境:

helin@helin:~$ conda create -n python3 python=3.7

启动新环境:

$ conda activate python3

退出新环境:

(python3) helin@helin:~$ conda deactivate

安装桌面环境:

$ conda install anaconda-navigator

管理环境:

conda info -e 环境信息

conda create -n test python=2.7 创建环境test,并指定python版本,此例为2.7

source activate test 激活环境

source deactivate test 关闭环境

conda remove --name test --all 删除环境

管理包:

conda list 列出所有安装的包的信息

conda search beautiful-soup 查询包

conda install -n test beautiful-soup 安装包,并指定安装环境,如果没有-n test,则安装到当前环境

conda update beautiful-soup 升级包

conda remove -n test beautiful-soup 移除包

常用命令:

1) conda list 查看安装了哪些包。

2)conda env list 或 conda info -e 查看当前存在哪些虚拟环境

3)conda update conda 检查更新当前conda

4) conda create -n py27 python=2.7

  conda create -n py35 python=3.5

5) python -version 检查当前环境python版本

6)source active py27(py35) 激活虚拟环境

7)conda install -n py35 [包名] 将包安装到虚拟环境下

8)deactivate py35 关闭虚拟环境

9)conda remove -n py27 --all 移除虚拟环境

10)conda remove --name $py35 $package_name 移除环境中的某个包

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容