1、下载
anaconda所有版本链接:https://repo.continuum.io/archive/
清华大学开源软件镜像站:https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/
进官网选择你电脑对应的版本下载下来就是了。 下载下来得到相应的一个.sh文件。
2、安装
1)直接用bash命令来运行就行。如下图。
2)然后一路根据提示安装就行。到最后,会有一个提示,问你是不是想要把Anaconda的python作为默认的python,这里建议选择是。如下图。
也就意味着,之后要是安装什么东西需要python的路径的时候,你需要使用这个新的路径。
3)提示信息“Do you wish to proceed with the installation of Microsoft VSCode? [yes|no]”,输入no;
4)重启终端,即可使用anaconda3.
5)若在终端输入 python,仍然会显示Ubuntu自带的python版本,我们执行:
sudo gedit ~/.bashrc
export PATH="/home/xupp/anaconda3/bin:$PATH"
source ~/.bashrc
修改终端的默认 python 为 anaconda,至此全部完成
6)ps:修改anaconda python版本
直接将现有的anaconda中python更改为3.5,
打开终端,执行指令:sudo conda install python=3.5
7)conda相关指令:
bash Anaconda3-2019.07-Linux-x86_64.sh #安装 yes+回车 #然后重启terminal
rm -rf anaconda //ubuntu 卸载anaconda
conda update -n base conda #update最新版本的conda
conda create -n xxxx python=3.5 #创建python3.5的xxxx虚拟环境
conda activate xxxx #开启xxxx环境
conda deactivate #关闭环境
conda env list #显示所有的虚拟环境
conda info --envs #显示所有的虚拟环境
anaconda search -t conda tensorflow #查看指定包可安装版本信息命令
conda serach --full-name package_full_name #--full-name:精确查找
conda search text #模糊查找
conda list #查看已经安装的文件包
conda list -n xxx #指定查看xxx虚拟环境下安装的package
conda update xxx #更新xxx文件包
conda uninstall xxx #卸载xxx文件包
conda remove -n xxxx --all //删除xxxx虚拟环境
conda clean -p //删除没有用的包
conda clean -t //删除tar包
conda clean -y --all //删除所有的安装包及cache
conda clean --packages #删除从不使用的包
conda clean --tarballs #删除tar包
conda clean -a #删除索引缓存、锁定文件、未使用过的包和tar包。
conda create --name newname --clone oldname //克隆oldname环境为newname环境
conda remove --name oldname --all //彻底删除旧环境
#显示目前conda的数据源有哪些
conda config --show channels
#添加数据源:例如, 添加清华anaconda镜像:
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
#删除数据源
conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
#pip 安装本地包
pip install ~/Downloads/a.whl
#conda 安装本地包
conda install --use-local ~/Downloads/a.tar.bz2
8)源:
#阿里云
http://mirrors.aliyun.com/pypi/simple/
#中国科技大学
https://pypi.mirrors.ustc.edu.cn/simple/
#豆瓣(douban)
http://pypi.douban.com/simple/
#清华大学
https://pypi.tuna.tsinghua.edu.cn/simple/
#中国科学技术大学
http://pypi.mirrors.ustc.edu.cn/simple/