安装miniconda与jupyter

安装miniconda

# 1.下载miniconda
curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh

# 2.赋权
chmod +x Miniconda3-latest-Linux-x86_64.sh

# 3.执行
./Miniconda3-latest-Linux-x86_64.sh

# 4.此时一路安装即可,输入 yes

# 5.激活与验证,安装完成后需要重新加载配置文件,或关闭终端重新打开
# 刷新当前终端配置文件
source ~/.bashrc
# 验证是否安装成功
conda --version

安装jupyter

# 1.为jupyter创建一个独立环境,需要注意的是第一次创建环境的时候,会要求接受条款或移除官方条款
conda create -n jupyter_env python=3.10 -y
# 接受服务条款
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main
conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r
# 移除官方条款,使用开源社区conda-forge频道
# 查看当前频道列表
conda config --show channels
# 移除默认的 defaults 以及相关的URL
conda config --remove channels defaults
conda config --remove channels https://repo.anaconda.com/pkgs/main
conda config --remove channels https://repo.anaconda.com/pkgs/r
# 添加 conda-forge 并设为最高优先级
conda config --add channels conda-forge
conda config --set channel_priority strict

# 2.选择该环境
conda activate jupyter_env

# 3.安装jupyter
conda install jupyter -y 

# 4.启动jupyter,需要注意的是,通常我们不用root权限来启动,所以需要注意创建jupyter conda环境时,
# 尽量创建一个专用的普通用户来创建 jupyter的conda环境。
# 如果用于临时测试,可以加上 --allow-root 忽略启动提示
nohup  jupyter notebook --ip=0.0.0.0 --port=8888 --no-browser --allow-root > output.log 2>&1 &