跳转至

Rocky Linux 9.3 安装 notebook

约 555 个字 529 行代码 预计阅读时间 8 分钟

一、安装anaconda

1、下载anaconda安装包

打开anaconda官网下载地址,如下: https://www.anaconda.com/download 找到要下载的linux版本地址链接,然后使用wget命令下载到本地。 因为下载速度原因,也可以使用国内镜像源的,我这里使用的是清华源的

wget --user-agent=“Mozilla” https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2023.09-0-Linux-x86_64.sh

点击查看执行示例
执行示例.log
[fotianmoyin@fotianmoyin-ecs ~]$ wget --user-agent=“Mozilla” https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2023.09-0-Linux-x86_64.sh
--2024-02-20 23:56:18--  https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2023.09-0-Linux-x86_64.sh
Resolving mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)... 101.6.15.130, 2402:f000:1:400::2
Connecting to mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)|101.6.15.130|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1153404010 (1.1G) [application/octet-stream]
Saving to: ‘Anaconda3-2023.09-0-Linux-x86_64.sh’

Anaconda3-2023.09-0-Lin 100%[==============================>]   1.07G  11.6MB/s    in 92s     

2024-02-20 23:57:50 (12.0 MB/s) - ‘Anaconda3-2023.09-0-Linux-x86_64.sh’ saved [1153404010/1153404010]

[fotianmoyin@fotianmoyin-ecs ~]$ ll
total 1126372
-rw-r--r-- 1 fotianmoyin fotianmoyin 1153404010 Sep 29 23:47 Anaconda3-2023.09-0-Linux-x86_64.sh

2、安装anaconda

执行如下命令,安装:

sh ./Anaconda3-2023.09-0-Linux-x86_64.sh

点击查看执行示例
执行示例.log
[fotianmoyin@fotianmoyin-ecs ~]$ sh ./Anaconda3-2023.09-0-Linux-x86_64.sh 

Welcome to Anaconda3 2023.09-0

In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>>  
==================================================
End User License Agreement - Anaconda Distribution
==================================================

Copyright 2015-2023, Anaconda, Inc.

All rights reserved under the 3-clause BSD License:

This End User License Agreement (the "Agreement") is a legal agreement between you and Anaconda
, Inc. ("Anaconda") and governs your use of Anaconda Distribution (which was formerly known as 
Anaconda Individual Edition).

Subject to the terms of this Agreement, Anaconda hereby grants you a non-exclusive, non-transfe
rable license to:

  * Install and use the Anaconda Distribution (which was formerly known as Anaconda Individual 
Edition),
  * Modify and create derivative works of sample source code delivered in Anaconda Distribution
from Anaconda's repository, and;
  * Redistribute code files in source (if provided to you by Anaconda as source) and binary for
ms, with or without modification subject to the requirements set forth below, and;

Anaconda may, at its option, make available patches, workarounds or other updates to Anaconda D
istribution. Unless the updates are provided with their separate governing terms, they are deem
ed part of Anaconda Distribution licensed to you as provided in this Agreement.  This Agreement
does not entitle you to any support for Anaconda Distribution.

Anaconda reserves all rights not expressly granted to you in this Agreement.

Redistribution and use in source and binary forms, with or without modification, are permitted 
provided that the following conditions are met:

  * Redistributions of source code must retain the above copyright notice, this list of conditi
ons and the following disclaimer.
  * Redistributions in binary form must reproduce the above copyright notice, this list of cond
itions and the following disclaimer in the documentation and/or other materials provided with t
he distribution.
  * Neither the name of Anaconda nor the names of its contributors may be used to endorse or pr
omote products derived from this software without specific prior written permission.
  * The purpose of the redistribution is not part of a commercial product for resale. Please co
ntact the Anaconda team for a third party redistribution commercial license
  * Commercial usage of the repository is non-compliant with our Terms of Service . Please cont
act us to learn more about our commercial offerings.

You acknowledge that, as between you and Anaconda, Anaconda owns all right, title, and interest
, including all intellectual property rights, in and to Anaconda Distribution and, with respect
to third-party products distributed with or through Anaconda Distribution, the applicable thir
d-party licensors own all right, title and interest, including all intellectual property rights
, in and to such products.  If you send or transmit any communications or materials to Anaconda
suggesting or recommending changes to the software or documentation, including without limitat
ion, new features or functionality relating thereto, or any comments, questions, suggestions or
the like ("Feedback"), Anaconda is free to use such Feedback. You hereby assign to Anaconda al
l right, title, and interest in, and Anaconda is free to use, without any attribution or compen
sation to any party, any ideas, know-how, concepts, techniques or other intellectual property r
ights contained in the Feedback, for any purpose whatsoever, although Anaconda is not required 
to use any Feedback.

THIS SOFTWARE IS PROVIDED BY ANACONDA AND ITS CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED W
ARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANACONDA BE LIABLE FOR ANY DIRECT, 
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INT
ERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY
, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWAR
E, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

TO THE MAXIMUM EXTENT PERMITTED BY LAW, ANACONDA AND ITS AFFILIATES SHALL NOT BE LIABLE FOR ANY
SPECIAL, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES, OR ANY LOST PROFITS, LOSS OF USE, LOSS
OF DATA OR LOSS OF GOODWILL, OR THE COSTS OF PROCURING SUBSTITUTE PRODUCTS, ARISING OUT OF OR 
IN CONNECTION WITH THIS AGREEMENT OR THE USE OR PERFORMANCE OF ANACONDA DISTRIBUTION, WHETHER S
UCH LIABILITY ARISES FROM ANY CLAIM BASED UPON BREACH OF CONTRACT, BREACH OF WARRANTY, TORT (IN
CLUDING NEGLIGENCE), PRODUCT LIABILITY OR ANY OTHER CAUSE OF ACTION OR THEORY OF LIABILITY. IN 
NO EVENT WILL THE TOTAL CUMULATIVE LIABILITY OF ANACONDA AND ITS AFFILIATES UNDER OR ARISING OU
T OF THIS AGREEMENT EXCEED 10.00 U.S. DOLLARS.

If you want to terminate this Agreement, you may do so by discontinuing use of Anaconda Distrib
ution.  Anaconda may, at any time, terminate this Agreement and the license granted hereunder i
f you fail to comply with any term of this Agreement.   Upon any termination of this Agreement,
you agree to promptly discontinue use of the Anaconda Distribution and destroy all copies in y
our possession or control. Upon any termination of this Agreement all provisions survive except
for the licenses granted to you.

This Agreement is governed by and construed in accordance with the internal laws of the State o
f Texas without giving effect to any choice or conflict of law provision or rule that would req
uire or permit the application of the laws of any jurisdiction other than those of the State of
Texas. Any legal suit, action, or proceeding arising out of or related to this Agreement or th
e licenses granted hereunder by you must be instituted exclusively in the federal courts of the
United States or the courts of the State of Texas in each case located in Travis County, Texas
, and you irrevocably submit to the jurisdiction of such courts in any such suit, action, or pr
oceeding.

Notice of Third Party Software Licenses
=======================================

Anaconda Distribution provides access to a repository which contains software packages or tools
licensed on an open source basis from third parties and binary packages of these third party t
ools. These third party software packages or tools are provided on an "as is" basis and are sub
ject to their respective license agreements as well as this Agreement and the Terms of Service 
for the Repository located at https://know.anaconda.com/TOS.html; provided, however, no restric
tion contained in the Terms of Service shall be construed so as to limit Your ability to downlo
ad the packages contained in Anaconda Distribution provided you comply with the license for eac
h such package.  These licenses may be accessed from within the Anaconda Distribution software 
or https://www.anaconda.com/legal. Information regarding which license is applicable is availab
le from within many of the third party software packages and tools and at https://repo.anaconda
.com/pkgs/main/ and https://repo.anaconda.com/pkgs/r/. Anaconda reserves the right, in its sole
discretion, to change which third party tools are included in the repository accessible throug
h Anaconda Distribution.

Intel Math Kernel Library
-------------------------

Anaconda Distribution provides access to re-distributable, run-time, shared-library files from 
the Intel Math Kernel Library ("MKL binaries").

Copyright 2018 Intel Corporation.  License available at https://software.intel.com/en-us/licens
e/intel-simplified-software-license (the "MKL License").

You may use and redistribute the MKL binaries, without modification, provided the following con
ditions are met:

  * Redistributions must reproduce the above copyright notice and the following terms of use in
the MKL binaries and in the documentation and/or other materials provided with the distributio
n.
  * Neither the name of Intel nor the names of its suppliers may be used to endorse or promote 
products derived from the MKL binaries without specific prior written permission.
  * No reverse engineering, decompilation, or disassembly of the MKL binaries is permitted.

You are specifically authorized to use and redistribute the MKL binaries with your installation
of Anaconda Distribution subject to the terms set forth in the MKL License. You are also autho
rized to redistribute the MKL binaries with Anaconda Distribution or in the Anaconda package th
at contains the MKL binaries. If needed, instructions for removing the MKL binaries after insta
llation of Anaconda Distribution are available at https://docs.anaconda.com.

cuDNN Software
--------------

Anaconda Distribution also provides access to cuDNN software binaries ("cuDNN binaries") from N
VIDIA Corporation. You are specifically authorized to use the cuDNN binaries with your installa
tion of Anaconda Distribution subject to your compliance with the license agreement located at 
https://docs.nvidia.com/deeplearning/sdk/cudnn-sla/index.html. You are also authorized to redis
tribute the cuDNN binaries with an Anaconda Distribution package that contains the cuDNN binari
es. You can add or remove the cuDNN binaries utilizing the install and uninstall features in An
aconda Distribution.

cuDNN binaries contain source code provided by NVIDIA Corporation.

Arm Performance Libraries
-------------------------

Arm Performance Libraries (Free Version): Anaconda provides access to software and related docu
mentation from the Arm Performance Libraries ("Arm PL") provided by Arm Limited. By installing 
or otherwise accessing the Arm PL, you acknowledge and agree that use and distribution of the A
rm PL is subject to your compliance with the Arm PL end user license agreement located at: http
s://developer.arm.com/tools-and-software/server-and-hpc/downloads/arm-performance-libraries/eul
a.

Export; Cryptography Notice
===========================

You must comply with all domestic and international export laws and regulations that apply to t
he software, which include restrictions on destinations, end users, and end use.  Anaconda Dist
ribution includes cryptographic software. The country in which you currently reside may have re
strictions on the import, possession, use, and/or re-export to another country, of encryption s
oftware. BEFORE using any encryption software, please check your country's laws, regulations an
d policies concerning the import, possession, or use, and re-export of encryption software, to 
see if this is permitted. See the Wassenaar Arrangement http://www.wassenaar.org/ for more info
rmation.

Anaconda has self-classified this software as Export Commodity Control Number (ECCN) EAR99 whic
h includes mass market information security software using or performing cryptographic function
s with asymmetric algorithms. No license is required for export of this software to non-embargo
ed countries.

The Intel Math Kernel Library contained in Anaconda Distribution is classified by Intel as ECCN
5D992.c with no license required for export to non-embargoed countries.

The following packages listed on https://www.anaconda.com/cryptography are included in the repo
sitory accessible through Anaconda Distribution that relate to cryptography.

Last updated February 25, 2022


Do you accept the license terms? [yes|no]
[no] >>> yes

Anaconda3 will now be installed into this location:
/home/fotianmoyin/anaconda3

  - Press ENTER to confirm the location
  - Press CTRL-C to abort the installation
  - Or specify a different location below

[/home/fotianmoyin/anaconda3] >>> 
PREFIX=/home/fotianmoyin/anaconda3

Unpacking payload ...

Installing base environment...


Downloading and Extracting Packages


Downloading and Extracting Packages

Preparing transaction: done
Executing transaction: - 

    Installed package of scikit-learn can be accelerated using scikit-learn-intelex.
    More details are available here: https://intel.github.io/scikit-learn-intelex

    For example:

        $ conda install scikit-learn-intelex
        $ python -m sklearnex my_application.py



done
installation finished.
Do you wish to update your shell profile to automatically initialize conda?
This will activate conda on startup and change the command prompt when activated.
If you'd prefer that conda's base environment not be activated on startup,
  run the following command when conda is activated:

conda config --set auto_activate_base false

You can undo this by running `conda init --reverse $SHELL`? [yes|no]
[no] >>> 
You have chosen to not have conda modify your shell scripts at all.
To activate conda's base environment in your current shell session:

eval "$(/home/fotianmoyin/anaconda3/bin/conda shell.YOUR_SHELL_NAME hook)" 

To install conda's shell functions for easier access, first activate, then:

conda init

Thank you for installing Anaconda3!

这里,最后那个更改shell配置的选项,我手欠打了yes。结果conda命令不可用,不过可以通过一下方法调整。 执行一下命令:

eval "$(/home/fotianmoyin/anaconda3/bin/conda shell.bash hook)"

点击查看执行示例
执行示例.log
[fotianmoyin@fotianmoyin-ecs ~]$ eval "$(/home/fotianmoyin/anaconda3/bin/conda shell.bash hook)
"
(base) [fotianmoyin@fotianmoyin-ecs ~]$

这样,会激活conda的base环境(命令行提示以(base)开头)。然后,我们再执行以下命令:

conda init

点击查看执行示例
执行示例.log
(base) [fotianmoyin@fotianmoyin-ecs ~]$ conda init
no change     /home/fotianmoyin/anaconda3/condabin/conda
no change     /home/fotianmoyin/anaconda3/bin/conda
no change     /home/fotianmoyin/anaconda3/bin/conda-env
no change     /home/fotianmoyin/anaconda3/bin/activate
no change     /home/fotianmoyin/anaconda3/bin/deactivate
no change     /home/fotianmoyin/anaconda3/etc/profile.d/conda.sh
no change     /home/fotianmoyin/anaconda3/etc/fish/conf.d/conda.fish
no change     /home/fotianmoyin/anaconda3/shell/condabin/Conda.psm1
no change     /home/fotianmoyin/anaconda3/shell/condabin/conda-hook.ps1
no change     /home/fotianmoyin/anaconda3/lib/python3.11/site-packages/xontrib/conda.xsh
no change     /home/fotianmoyin/anaconda3/etc/profile.d/conda.csh
modified      /home/fotianmoyin/.bashrc

==> For changes to take effect, close and re-open your current shell. <==

好了,conda命令可用了。我们执行以下命令,禁止默认进入base环境,这样可以避免不注意的情况下在base环境安装包。

conda config --set auto_activate_base false

3、配置anaconda镜像源为阿里云

编辑用户根目录下的.condarc文件,将以下内容加入到anconda的配置文件中(可以使用vim编辑,也可以将这个文件下载到本地,编辑后再上传覆盖)。

channels:
  - defaults
show_channel_urls: true
default_channels:
  - http://mirrors.aliyun.com/anaconda/pkgs/main
  - http://mirrors.aliyun.com/anaconda/pkgs/r
  - http://mirrors.aliyun.com/anaconda/pkgs/msys2
custom_channels:
  conda-forge: http://mirrors.aliyun.com/anaconda/cloud
  msys2: http://mirrors.aliyun.com/anaconda/cloud
  bioconda: http://mirrors.aliyun.com/anaconda/cloud
  menpo: http://mirrors.aliyun.com/anaconda/cloud
  pytorch: http://mirrors.aliyun.com/anaconda/cloud
  simpleitk: http://mirrors.aliyun.com/anaconda/cloud

二、安装notebook

1、虚拟环境的基本操作

  • 创建虚拟环境
    conda create -n [虚拟环境名]
    
  • 激活虚拟环境
    conda activate [虚拟环境名]
    
  • 退出虚拟环境
    conda deactivate
    
  • 查看虚拟环境
    conda env list
    
  • 删除虚拟环境
    conda remove -n [虚拟环境名] --all
    
  • 克隆虚拟环境
    conda create -n [新虚拟环境名] --clone [旧虚拟环境名]
    

2、创建虚拟环境

执行以下命令,创建虚拟环境py311

conda create -n py311

点击查看执行示例
执行示例.log
[fotianmoyin@fotianmoyin-ecs ~]$ conda create -n py311
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /home/fotianmoyin/anaconda3/envs/py311



Proceed ([y]/n)? 

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate py311
#
# To deactivate an active environment, use
#
#     $ conda deactivate

执行以下命令,激活虚拟环境py311

conda activate py311

点击查看执行示例
执行示例.log
[fotianmoyin@fotianmoyin-ecs ~]$ conda activate py311
(py311) [fotianmoyin@fotianmoyin-ecs ~]$ 

3、给虚拟环境安装python3.11

执行以下命令安装python3.11

conda install python=3.11

点击查看执行示例
执行示例.log
(py311) [fotianmoyin@fotianmoyin-ecs ~]$ conda install python=3.11
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /home/fotianmoyin/anaconda3/envs/py311

  added / updated specs:
    - python=3.11


The following NEW packages will be INSTALLED:

  _libgcc_mutex      anaconda/pkgs/main/linux-64::_libgcc_mutex-0.1-main 
  _openmp_mutex      anaconda/pkgs/main/linux-64::_openmp_mutex-5.1-1_gnu 
  bzip2              anaconda/pkgs/main/linux-64::bzip2-1.0.8-h7b6447c_0 
  ca-certificates    anaconda/pkgs/main/linux-64::ca-certificates-2023.12.12-h06a4308_0 
  ld_impl_linux-64   anaconda/pkgs/main/linux-64::ld_impl_linux-64-2.38-h1181459_1 
  libffi             anaconda/pkgs/main/linux-64::libffi-3.4.4-h6a678d5_0 
  libgcc-ng          anaconda/pkgs/main/linux-64::libgcc-ng-11.2.0-h1234567_1 
  libgomp            anaconda/pkgs/main/linux-64::libgomp-11.2.0-h1234567_1 
  libstdcxx-ng       anaconda/pkgs/main/linux-64::libstdcxx-ng-11.2.0-h1234567_1 
  libuuid            anaconda/pkgs/main/linux-64::libuuid-1.41.5-h5eee18b_0 
  ncurses            anaconda/pkgs/main/linux-64::ncurses-6.4-h6a678d5_0 
  openssl            anaconda/pkgs/main/linux-64::openssl-3.0.13-h7f8727e_0 
  pip                anaconda/pkgs/main/linux-64::pip-23.3.1-py311h06a4308_0 
  python             anaconda/pkgs/main/linux-64::python-3.11.7-h955ad1f_0 
  readline           anaconda/pkgs/main/linux-64::readline-8.2-h5eee18b_0 
  setuptools         anaconda/pkgs/main/linux-64::setuptools-68.2.2-py311h06a4308_0 
  sqlite             anaconda/pkgs/main/linux-64::sqlite-3.41.2-h5eee18b_0 
  tk                 anaconda/pkgs/main/linux-64::tk-8.6.12-h1ccaba5_0 
  tzdata             anaconda/pkgs/main/noarch::tzdata-2023d-h04d1e81_0 
  wheel              anaconda/pkgs/main/linux-64::wheel-0.41.2-py311h06a4308_0 
  xz                 anaconda/pkgs/main/linux-64::xz-5.4.5-h5eee18b_0 
  zlib               anaconda/pkgs/main/linux-64::zlib-1.2.13-h5eee18b_0 


Proceed ([y]/n)? 


Downloading and Extracting Packages

Preparing transaction: done
Verifying transaction: done
Executing transaction: done

3、安装notebook

执行以下命令,安装notebook

conda install notebook

点击查看执行示例
执行示例.log
(py311) [fotianmoyin@fotianmoyin-ecs ~]$ conda install notebook
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /home/fotianmoyin/anaconda3/envs/py311

  added / updated specs:
    - notebook


The following NEW packages will be INSTALLED:

  anyio              anaconda/pkgs/main/linux-64::anyio-4.2.0-py311h06a4308_0 
  argon2-cffi        anaconda/pkgs/main/noarch::argon2-cffi-21.3.0-pyhd3eb1b0_0 
  argon2-cffi-bindi~ anaconda/pkgs/main/linux-64::argon2-cffi-bindings-21.2.0-py311h5eee18b_0 
  asttokens          anaconda/pkgs/main/noarch::asttokens-2.0.5-pyhd3eb1b0_0 
  async-lru          anaconda/pkgs/main/linux-64::async-lru-2.0.4-py311h06a4308_0 
  attrs              anaconda/pkgs/main/linux-64::attrs-23.1.0-py311h06a4308_0 
  babel              anaconda/pkgs/main/linux-64::babel-2.11.0-py311h06a4308_0 
  beautifulsoup4     anaconda/pkgs/main/linux-64::beautifulsoup4-4.12.2-py311h06a4308_0 
  bleach             anaconda/pkgs/main/noarch::bleach-4.1.0-pyhd3eb1b0_0 
  brotli-python      anaconda/pkgs/main/linux-64::brotli-python-1.0.9-py311h6a678d5_7 
  certifi            anaconda/pkgs/main/linux-64::certifi-2024.2.2-py311h06a4308_0 
  cffi               anaconda/pkgs/main/linux-64::cffi-1.16.0-py311h5eee18b_0 
  charset-normalizer anaconda/pkgs/main/noarch::charset-normalizer-2.0.4-pyhd3eb1b0_0 
  comm               anaconda/pkgs/main/linux-64::comm-0.1.2-py311h06a4308_0 
  debugpy            anaconda/pkgs/main/linux-64::debugpy-1.6.7-py311h6a678d5_0 
  decorator          anaconda/pkgs/main/noarch::decorator-5.1.1-pyhd3eb1b0_0 
  defusedxml         anaconda/pkgs/main/noarch::defusedxml-0.7.1-pyhd3eb1b0_0 
  executing          anaconda/pkgs/main/noarch::executing-0.8.3-pyhd3eb1b0_0 
  idna               anaconda/pkgs/main/linux-64::idna-3.4-py311h06a4308_0 
  ipykernel          anaconda/pkgs/main/linux-64::ipykernel-6.28.0-py311h06a4308_0 
  ipython            anaconda/pkgs/main/linux-64::ipython-8.20.0-py311h06a4308_0 
  jedi               anaconda/pkgs/main/linux-64::jedi-0.18.1-py311h06a4308_1 
  jinja2             anaconda/pkgs/main/linux-64::jinja2-3.1.3-py311h06a4308_0 
  json5              anaconda/pkgs/main/noarch::json5-0.9.6-pyhd3eb1b0_0 
  jsonschema         anaconda/pkgs/main/linux-64::jsonschema-4.19.2-py311h06a4308_0 
  jsonschema-specif~ anaconda/pkgs/main/linux-64::jsonschema-specifications-2023.7.1-py311h06a4308_0 
  jupyter-lsp        anaconda/pkgs/main/linux-64::jupyter-lsp-2.2.0-py311h06a4308_0 
  jupyter_client     anaconda/pkgs/main/linux-64::jupyter_client-8.6.0-py311h06a4308_0 
  jupyter_core       anaconda/pkgs/main/linux-64::jupyter_core-5.5.0-py311h06a4308_0 
  jupyter_events     anaconda/pkgs/main/linux-64::jupyter_events-0.8.0-py311h06a4308_0 
  jupyter_server     anaconda/pkgs/main/linux-64::jupyter_server-2.10.0-py311h06a4308_0 
  jupyter_server_te~ anaconda/pkgs/main/linux-64::jupyter_server_terminals-0.4.4-py311h06a4308_1 
  jupyterlab         anaconda/pkgs/main/linux-64::jupyterlab-4.0.11-py311h06a4308_0 
  jupyterlab_pygmen~ anaconda/pkgs/main/noarch::jupyterlab_pygments-0.1.2-py_0 
  jupyterlab_server  anaconda/pkgs/main/linux-64::jupyterlab_server-2.25.1-py311h06a4308_0 
  libsodium          anaconda/pkgs/main/linux-64::libsodium-1.0.18-h7b6447c_0 
  markupsafe         anaconda/pkgs/main/linux-64::markupsafe-2.1.3-py311h5eee18b_0 
  matplotlib-inline  anaconda/pkgs/main/linux-64::matplotlib-inline-0.1.6-py311h06a4308_0 
  mistune            anaconda/pkgs/main/linux-64::mistune-2.0.4-py311h06a4308_0 
  nbclient           anaconda/pkgs/main/linux-64::nbclient-0.8.0-py311h06a4308_0 
  nbconvert          anaconda/pkgs/main/linux-64::nbconvert-7.10.0-py311h06a4308_0 
  nbformat           anaconda/pkgs/main/linux-64::nbformat-5.9.2-py311h06a4308_0 
  nest-asyncio       anaconda/pkgs/main/linux-64::nest-asyncio-1.5.6-py311h06a4308_0 
  notebook           anaconda/pkgs/main/linux-64::notebook-7.0.8-py311h06a4308_0 
  notebook-shim      anaconda/pkgs/main/linux-64::notebook-shim-0.2.3-py311h06a4308_0 
  overrides          anaconda/pkgs/main/linux-64::overrides-7.4.0-py311h06a4308_0 
  packaging          anaconda/pkgs/main/linux-64::packaging-23.1-py311h06a4308_0 
  pandocfilters      anaconda/pkgs/main/noarch::pandocfilters-1.5.0-pyhd3eb1b0_0 
  parso              anaconda/pkgs/main/noarch::parso-0.8.3-pyhd3eb1b0_0 
  pexpect            anaconda/pkgs/main/noarch::pexpect-4.8.0-pyhd3eb1b0_3 
  platformdirs       anaconda/pkgs/main/linux-64::platformdirs-3.10.0-py311h06a4308_0 
  prometheus_client  anaconda/pkgs/main/linux-64::prometheus_client-0.14.1-py311h06a4308_0 
  prompt-toolkit     anaconda/pkgs/main/linux-64::prompt-toolkit-3.0.43-py311h06a4308_0 
  prompt_toolkit     anaconda/pkgs/main/noarch::prompt_toolkit-3.0.43-hd3eb1b0_0 
  psutil             anaconda/pkgs/main/linux-64::psutil-5.9.0-py311h5eee18b_0 
  ptyprocess         anaconda/pkgs/main/noarch::ptyprocess-0.7.0-pyhd3eb1b0_2 
  pure_eval          anaconda/pkgs/main/noarch::pure_eval-0.2.2-pyhd3eb1b0_0 
  pycparser          anaconda/pkgs/main/noarch::pycparser-2.21-pyhd3eb1b0_0 
  pygments           anaconda/pkgs/main/linux-64::pygments-2.15.1-py311h06a4308_1 
  pysocks            anaconda/pkgs/main/linux-64::pysocks-1.7.1-py311h06a4308_0 
  python-dateutil    anaconda/pkgs/main/noarch::python-dateutil-2.8.2-pyhd3eb1b0_0 
  python-fastjsonsc~ anaconda/pkgs/main/linux-64::python-fastjsonschema-2.16.2-py311h06a4308_0 
  python-json-logger anaconda/pkgs/main/linux-64::python-json-logger-2.0.7-py311h06a4308_0 
  pytz               anaconda/pkgs/main/linux-64::pytz-2023.3.post1-py311h06a4308_0 
  pyyaml             anaconda/pkgs/main/linux-64::pyyaml-6.0.1-py311h5eee18b_0 
  pyzmq              anaconda/pkgs/main/linux-64::pyzmq-25.1.2-py311h6a678d5_0 
  referencing        anaconda/pkgs/main/linux-64::referencing-0.30.2-py311h06a4308_0 
  requests           anaconda/pkgs/main/linux-64::requests-2.31.0-py311h06a4308_1 
  rfc3339-validator  anaconda/pkgs/main/linux-64::rfc3339-validator-0.1.4-py311h06a4308_0 
  rfc3986-validator  anaconda/pkgs/main/linux-64::rfc3986-validator-0.1.1-py311h06a4308_0 
  rpds-py            anaconda/pkgs/main/linux-64::rpds-py-0.10.6-py311hb02cf49_0 
  send2trash         anaconda/pkgs/main/linux-64::send2trash-1.8.2-py311h06a4308_0 
  six                anaconda/pkgs/main/noarch::six-1.16.0-pyhd3eb1b0_1 
  sniffio            anaconda/pkgs/main/linux-64::sniffio-1.3.0-py311h06a4308_0 
  soupsieve          anaconda/pkgs/main/linux-64::soupsieve-2.5-py311h06a4308_0 
  stack_data         anaconda/pkgs/main/noarch::stack_data-0.2.0-pyhd3eb1b0_0 
  terminado          anaconda/pkgs/main/linux-64::terminado-0.17.1-py311h06a4308_0 
  tinycss2           anaconda/pkgs/main/linux-64::tinycss2-1.2.1-py311h06a4308_0 
  tornado            anaconda/pkgs/main/linux-64::tornado-6.3.3-py311h5eee18b_0 
  traitlets          anaconda/pkgs/main/linux-64::traitlets-5.7.1-py311h06a4308_0 
  typing-extensions  anaconda/pkgs/main/linux-64::typing-extensions-4.9.0-py311h06a4308_1 
  typing_extensions  anaconda/pkgs/main/linux-64::typing_extensions-4.9.0-py311h06a4308_1 
  urllib3            anaconda/pkgs/main/linux-64::urllib3-2.1.0-py311h06a4308_1 
  wcwidth            anaconda/pkgs/main/noarch::wcwidth-0.2.5-pyhd3eb1b0_0 
  webencodings       anaconda/pkgs/main/linux-64::webencodings-0.5.1-py311h06a4308_1 
  websocket-client   anaconda/pkgs/main/linux-64::websocket-client-0.58.0-py311h06a4308_4 
  yaml               anaconda/pkgs/main/linux-64::yaml-0.2.5-h7b6447c_0 
  zeromq             anaconda/pkgs/main/linux-64::zeromq-4.3.5-h6a678d5_0 


Proceed ([y]/n)? 


Downloading and Extracting Packages

Preparing transaction: done
Verifying transaction: done
Executing transaction: done  

4、启动notebook

执行以下命令,启动notebook

jupyter notebook

点击查看执行示例
执行示例.log
(py311) [fotianmoyin@fotianmoyin-ecs ~]$ jupyter notebook
[I 2024-02-21 14:43:27.286 ServerApp] Package notebook took 0.0000s to import
[I 2024-02-21 14:43:27.296 ServerApp] Package jupyter_lsp took 0.0098s to import
[W 2024-02-21 14:43:27.296 ServerApp] A `_jupyter_server_extension_points` function was not found in jupyter_lsp. Instead, a `_jupyter_server_extension_paths` function was found and will be used for now. This function name will be deprecated in future releases of Jupyter Server.
[I 2024-02-21 14:43:27.304 ServerApp] Package jupyter_server_terminals took 0.0076s to import
[I 2024-02-21 14:43:27.305 ServerApp] Package jupyterlab took 0.0000s to import
[I 2024-02-21 14:43:27.328 ServerApp] Package notebook_shim took 0.0000s to import
[W 2024-02-21 14:43:27.328 ServerApp] A `_jupyter_server_extension_points` function was not found in notebook_shim. Instead, a `_jupyter_server_extension_paths` function was found and will be used for now. This function name will be deprecated in future releases of Jupyter Server.
[I 2024-02-21 14:43:27.329 ServerApp] jupyter_lsp | extension was successfully linked.
[I 2024-02-21 14:43:27.332 ServerApp] jupyter_server_terminals | extension was successfully linked.
[I 2024-02-21 14:43:27.336 ServerApp] jupyterlab | extension was successfully linked.
[I 2024-02-21 14:43:27.339 ServerApp] notebook | extension was successfully linked.
[I 2024-02-21 14:43:27.340 ServerApp] Writing Jupyter server cookie secret to /home/fotianmoyin/.local/share/jupyter/runtime/jupyter_cookie_secret
[I 2024-02-21 14:43:27.560 ServerApp] notebook_shim | extension was successfully linked.
[I 2024-02-21 14:43:27.578 ServerApp] notebook_shim | extension was successfully loaded.
[I 2024-02-21 14:43:27.580 ServerApp] jupyter_lsp | extension was successfully loaded.
[I 2024-02-21 14:43:27.581 ServerApp] jupyter_server_terminals | extension was successfully loaded.
[I 2024-02-21 14:43:27.582 LabApp] JupyterLab extension loaded from /home/fotianmoyin/anaconda3/envs/py311/lib/python3.11/site-packages/jupyterlab
[I 2024-02-21 14:43:27.582 LabApp] JupyterLab application directory is /home/fotianmoyin/anaconda3/envs/py311/share/jupyter/lab
[I 2024-02-21 14:43:27.582 LabApp] Extension Manager is 'pypi'.
[I 2024-02-21 14:43:27.584 ServerApp] jupyterlab | extension was successfully loaded.
[I 2024-02-21 14:43:27.586 ServerApp] notebook | extension was successfully loaded.
[I 2024-02-21 14:43:27.587 ServerApp] Serving notebooks from local directory: /home/fotianmoyin
[I 2024-02-21 14:43:27.587 ServerApp] Jupyter Server 2.10.0 is running at:
[I 2024-02-21 14:43:27.587 ServerApp] http://localhost:8888/tree?token=648e0e22013581a92ad2b525324024a3b780fa5895272690
[I 2024-02-21 14:43:27.587 ServerApp]     http://127.0.0.1:8888/tree?token=648e0e22013581a92ad2b525324024a3b780fa5895272690
[I 2024-02-21 14:43:27.587 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 2024-02-21 14:43:27.590 ServerApp] No web browser found: Error('could not locate runnable browser').
[C 2024-02-21 14:43:27.590 ServerApp] 

    To access the server, open this file in a browser:
        file:///home/fotianmoyin/.local/share/jupyter/runtime/jpserver-5833-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/tree?token=648e0e22013581a92ad2b525324024a3b780fa5895272690
        http://127.0.0.1:8888/tree?token=648e0e22013581a92ad2b525324024a3b780fa5895272690
[I 2024-02-21 14:43:27.600 ServerApp] Skipped non-installed server(s): bash-language-server, dockerfile-language-server-nodejs, javascript-typescript-langserver, jedi-language-server, julia-language-server, pyright, python-language-server, python-lsp-server, r-languageserver, sql-language-server, texlab, typescript-language-server, unified-language-server, vscode-css-languageserver-bin, vscode-html-languageserver-bin, vscode-json-languageserver-bin, yaml-language-server

至此,再Rocky Linux 9.3上使用Anaconda安装notebook就完成了。但是因为是服务器,所以还不太好访问,下一步,我将部署一个nginx来反向代理notebook,从而解决访问难的问题。