Anaconda配置记录-linux环境

Anaconda® Distribution 是一个 Python/R 数据科学分发,其中包含:

依赖前提 

默认情况下,该包随 Anaconda Distribution 一起安装,并包含依赖项包。默认情况下,也应安装所有依赖项,但某些版本的 Anaconda Distribution 可能需要安装以下扩展依赖项,以便将 GUI(图形用户界面)包与 Linux 一起使用:anaconda-navigator qt qt

apt-get install libgl1-mesa-glx libegl1-mesa libxrandr2 libxrandr2 libxss1 libxcursor1 libxcomposite1 libasound2 libxi6 libxtst6

开始安装    [LINUX-X86]

1.To download the installer, open a terminal and use the following command, depending on your Linux architecture:
要下载安装程序,请打开一个终端并使用以下命令,具体取决于您的 Linux 体系结构: 

  • 在 repo.anaconda.com/archive/ 上查看 Anaconda Distribution 安装程序的完整列表。最新的安装程序版本始终位于列表的顶部。

2.(Optional) Anaconda recommends verifying the integrity of the installer after downloading it.
(可选)Anaconda 建议在下载安装程序后验证安装程序的完整性。

您可以使用与所选安装程序匹配的 SHA-256 哈希来验证安装程序的数据完整性。有关安装程序及其哈希的列表,请参阅哈希索引。有关哈希验证的详细信息,请参阅官方 conda 文档中的加密哈希验证。

To check the integrity of the installer, run the following command:
要检查安装程序的完整性,请运行以下命令:

# If downloaded via the browser, this should be in the Downloads folder
# If downloaded using the curl command, this will be the current directory
shasum -a 256 /PATH/TO/INSTALLER-FILENAME

For example:

shasum -a 256 Downloads/Anaconda3-2023.09-0-Linux-x86_64.sh 

3.To install, run the following command, depending on your Linux architecture:
若要安装,请运行以下命令,具体取决于 Linux 体系结构:

# Include the bash command even if you aren't using the Bash shell
# Replace ~/Downloads with the path to the installer file, if necessary
# Replace <INSTALLER_VERSION> with the version of the installer file
# For example, Anaconda3-2023.09-0-Linux-x86_64.sh
bash ~/Downloads/Anaconda3-<INSTALLER_VERSION>-Linux-x86_64.sh

4.Press Enter to review the license agreement. Then press and hold Enter to scroll.
按 Enter 键查看许可协议。然后按住 Enter 键进行滚动。 

5.Enter yes to agree to the license agreement.
输入 yes 以同意许可协议。

6.Use Enter to accept the default install location, use CTRL+C to cancel the installation, or enter another file path to specify an alternate installation directory. If you accept the default install location, the installer displays PREFIX=/home/<USER>/anaconda3 and continues the installation. It may take a few minutes to complete.

使用 Enter 接受默认安装位置,使用 CTRL+C 取消安装,或输入其他文件路径指定备用安装目录。如果接受默认安装位置,安装程序将显示 PREFIX=/home/<USER>/anaconda3 并继续安装。这可能需要几分钟才能完成。

我的地址: 默认      PREFIX=/home/<USER>/anaconda3

Note 注意

Anaconda recommends you accept the default install location. Do not choose the path as /usr for the Anaconda/Miniconda installation.
Anaconda 建议您接受默认安装位置。不要选择 Anaconda/Miniconda 安装的路径 /usr

7.Anaconda recommends you enter “yes” to initialize Anaconda Distribution by running conda init.
Anaconda 建议您输入“yes”以通过运行 conda init 来初始化 Anaconda Distribution。

If you enter “no”, then conda will not modify your shell scripts at all. In order to initialize conda after the installation process is done, run the following commands:
如果输入“no”,则 conda 根本不会修改您的 shell 脚本。为了在安装过程完成后初始化conda,请运行以下命令:    For more information, see the FAQ.

# Replace <PATH_TO_CONDA> with the path to your conda install
source <PATH_TO_CONDA>/bin/activate
conda init

8.The installer finishes and displays, “Thank you for installing Anaconda3!”
安装程序完成并显示“感谢您安装 Anaconda3!

9.Close and re-open your terminal window for the installation to take effect, or enter the command source ~/.bashrc to refresh the terminal.
关闭并重新打开终端窗口以使安装生效,或输入命令 source ~/.bashrc 以刷新终端。

10.You can also control whether or not your shell has the base environment activated each time it opens.    您还可以控制 shell 在每次打开时是否激活了基本环境。

# The base environment is activated by default
conda config --set auto_activate_base True

# The base environment is not activated by default
conda config --set auto_activate_base False

# The above commands only work if conda init has been run first
# conda init is available in conda versions 4.6.12 and later

11. Verify your installation.
验证您的安装.

Note 注意:

If you install multiple versions of Anaconda, the system defaults to the most current version, as long as you haven’t altered the default install path.
如果您安装了 Anaconda 的多个版本,只要您未更改默认安装路径,系统就会默认为最新版本。

验证:安装 Anaconda Distribution 后,如果安装成功,Anaconda Navigator 应自动打开。Anaconda Navigator 是一个图形用户界面 (GUI),随 Anaconda Distribution 一起自动安装。

Opening Navigator manually
手动打开 Navigator#

If Navigator does not open automatically, manually open it using the following instructions:
如果 Navigator 未自动打开,请按照以下说明手动打开它:

通过运行以下命令打开 Navigator:

anaconda-navigator

使用 conda 手动验证#

If you prefer using a command line interface (CLI), use conda to verify the installation.
如果您更喜欢使用命令行界面 (CLI),请使用 conda 来验证安装。

  • You should see (base) in the command line prompt. This tells you that you’re in your base conda environment. To learn more about environments, see Environments.
    您应该 (base) 在命令行提示符中看到。这告诉你,你处于基础 conda 环境中。要了解有关环境的更多信息,请参阅环境。

  • Verify your installation was successful by running one of the following commands:
    通过运行以下命令之一来验证安装是否成功:

    • conda list - If Anaconda Distribution is installed successfully, this displays a list of packages installed in your active environment and their versions.
      conda list - 如果 Anaconda Distribution 已成功安装,这将显示在您的活动环境中安装的软件包列表及其版本。

    • anaconda-navigator - If Anaconda Distribution is installed successfully, Anaconda Navigator opens.
      anaconda-navigator - 如果 Anaconda Distribution 安装成功,Anaconda Navigator 将打开。

Anaconda官方文档:

Anaconda Distribution — Anaconda documentationicon-default.png?t=N7T8https://docs.anaconda.com/anaconda/官方社区教程:

Get Started with AnacondaTake your first steps using Anaconda Distribution, working with conda, and writing your first Python program.icon-default.png?t=N7T8https://freelearning.anaconda.cloud/get-started-with-anaconda

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值