1、下载 Anaconda 3
2、安装 Anaconda 3
2.1 执行 bash 安装
2.2 提示 “conda:未找到命令” 的解决办法
3、anaconda 3 常用命令
4、添加/更换 conda 清华源
Anaconda 是 Python 的一个出色的集成开发工具集,包括了Python解释器、conda包管理器、以及众多集成好的数学科学库(numpy/pandas/matplotlib/scipy/sk-learn 等等)因此非常适合于对 python 有数据处理需求的工程师与学生使用,可以减少因包依赖导致的库下载失败而浪费时间。
1、下载 Anaconda 3国内用户可以从清华大学开源软件镜像站里面获取 Anaconda 3
https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/
根据日期排序,下载最新的版本,选择 Linux 64 位版本下载。
去到下载的文件夹内,执行命令:bash Anaconda3-2020.02-Linux-x86_64.sh
输入 yes
敲入回车
继续输入 yes
查看conda版本 :conda -V
查看python 版本:python -V
- 往 /.bashrc 文件末尾追加 anaconda 的路径(/home/yourname/anaconda3/)
echo 'export PATH="/home/majianwei/anaconda3/bin:$PATH"' >> ~/.bashrc - 更新source
source ~/.bashrc
重新执行下下面指令,能够正常打印版本号,就代表安装成功。
查看conda版本 :conda -V
查看python 版本:python -V
| 序号 | 功能 | 命令 | 备注 |
|---|---|---|---|
| 1 | 查看conda 版本 | conda --version conda -V | |
| 2 | 更新conda | conda update conda | |
| 3 | 查看conda帮助(对初学者很有用的命令) | conda --help conda -h | |
| 4 | 新建虚拟环境 | conda create --name | 多个包名用空格分开 |
| 5 | 切换conda环境 | conda activate env_name | |
| 6 | 退出虚拟环境 | conda deactivate | |
| 7 | 列出所有虚拟环境 | conda info --envs conda info -e conda env list | |
| 8 | 复制环境 | conda create --name new_env_name --clone copied_env_name | |
| 9 | 删除环境 | conda remove --name env_name --all | |
| 10 | 精确查找包 | conda search --full-name | |
| 11 | 模糊查找包 | conda search | |
| 12 | 获取当前环境中已安装的包信息 | conda list | |
| 13 | 指定环境安装包 | conda install --name 指定版本:conda install --name | |
| 14 | 在当前环境中安装包 | conda install | |
| 15 | pip安装 | pip install | conda装不了的(或没有的)可用pip来安装 |
conda config --add channels 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/'
conda config --add channels 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/'
conda config --set show_channel_urls yes
这是配置好的 .condarc 文件,查看命令vim ~/.condarc



