Install Anaconda Python, Jupyter Notebook, Spyder on Ubuntu 18.04 Linux / Ubuntu 20.04 LTS
目录:
Anaconda是最受欢迎的Python / R数据科学和机器学习平台。 它用于大规模数据处理,预测分析和科学计算。
Anaconda发行版附带了1500多个开源数据包。 它还包括conda命令行工具和称为Anaconda Navigator的桌面图形用户界面。
在本教程中,我们将指导您在Debian 10上下载并安装Anaconda Python Distribution。
安装Anaconda
在撰写本文时,Anaconda的最新稳定版本为2019.10。 在下载Anaconda安装程序脚本之前,请访问Anaconda下载页面,并检查是否有可用于Python 3的Anaconda新版本可供下载。


运行脚本以启动Anaconda安装过程:
sh /tmp/Anaconda3-2019.10-Linux-x86_64.sh
Welcome to Anaconda3 2019.10 In order to continue the installation process, please review the license agreement. Please, press ENTER to continue >>>
按
ENTER
继续,然后按
SPACE
滚动浏览许可证。 审核完许可证后,系统将提示您接受许可证条款:
Do you accept the license terms? >>> yes
键入
yes
接受许可,脚本将要求您选择安装位置。
Anaconda3 will now be installed into this location: /home/vagrant/anaconda3 - Press ENTER to confirm the location - Press CTRL-C to abort the installation - Or specify a different location below
默认位置适合大多数用户。 按
ENTER
确认位置,然后将开始安装过程。
安装可能需要一些时间。 完成后,您将看到以下内容:
Preparing transaction: done Executing transaction: done installation finished. Do you wish the installer to initialize Anaconda3 by running conda init?
ENTER
yes
,按
ENTER
,脚本会将
conda
添加到您的
PATH
:
==> For changes to take effect, close and re-open your current shell. <== If you'd prefer that conda's base environment not be activated on startup, set the auto_activate_base parameter to false: conda config --set auto_activate_base false Thank you for installing Anaconda3! =========================================================================== Anaconda and JetBrains are working together to bring you Anaconda-powered environments tightly integrated in the PyCharm IDE. PyCharm for Anaconda is available at:
要激活Anaconda安装,请使用以下命令将Anaconda安装程序添加的新
PATH
环境变量加载到当前Shell会话中:
source ~/.bashrc
要验证是否成功安装了Anaconda,请使用
conda
命令:
conda info
active environment: base active env location: /home/vagrant/anaconda3 shell level: 1 user config file: /home/vagrant/.condarc populated config files: conda version: 4.7.12 conda-build version: 3.18.9 python version: 3.7.4.final.0 virtual packages: base environment: /home/vagrant/anaconda3 (writable) channel URLs: https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch package cache: /home/vagrant/anaconda3/pkgs /home/vagrant/.conda/pkgs envs directories: /home/vagrant/anaconda3/envs /home/vagrant/.conda/envs platform: linux-64 user-agent: conda/4.7.12 requests/2.22.0 CPython/3.7.4 Linux/4.19.0-5-amd64 debian/10 glibc/2.28 UID:GID: 1000:1000 netrc file: None offline mode: False
更新水蟒
更新Anaconda是一个非常简单的过程。 首先使用以下命令更新
conda
工具:
conda update conda
当提示您确认更新时,键入
y
继续。
更新
conda
,继续进行Anaconda更新:
conda update anaconda
与之前相同,出现提示时,键入
y
继续。
您应该定期更新Anaconda安装。
卸载Anaconda
要从Debian系统上卸载Anaconda,请首先删除安装Anaconda的目录:
rm -rf ~/anaconda3
编辑
~/.bashrc
文件,然后从PATH环境变量中删除Anaconda目录:
# >>> conda initialize >>> # !! Contents within this block are managed by 'conda init' !! __conda_setup="$('/home/vagrant/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)" if; then eval "$__conda_setup" else if; then. "/home/vagrant/anaconda3/etc/profile.d/conda.sh" else export PATH="/home/vagrant/anaconda3/bin:$PATH" fi fi unset __conda_setup # <<< conda initialize <<<
运行以下
rm
命令以从用户主目录中删除隐藏的文件和文件夹:
rm -rf ~/.condarc ~/.conda ~/.continuum
```
结论
既然您已经在Debian系统上下载并安装了Anaconda,则可以查看官方的conda入门指南。
Debian水蟒如何在Debian 9上添加和删除用户
知道如何添加和删除用户是Linux用户应该知道的基本技能之一。 在本教程中,我们将向您展示如何在Debian 9上添加和删除用户。
如何在Debian 9上添加交换空间
交换是物理RAM内存已满时使用的磁盘空间。 本教程概述了在Debian 9系统上添加交换文件所必需的步骤。
如何在Debian 10 Linux上添加交换空间
交换是物理内存量已满时使用的磁盘空间。 本教程将指导您完成在Debian 10 Buster上添加交换文件的步骤。







