如果只是测试用,直接用下面的命令:
pip install jupyter notebook
如果是长期用,可以:
conda install jupyter notebook -y
可能会有报错:
(base) C:\Users\58615>conda install jupyter notebook -y
CondaToSNonInteractiveError: Terms of Service have not been accepted for the following channels. Please accept or remove them before proceeding:
- https://repo.anaconda.com/pkgs/main
- https://repo.anaconda.com/pkgs/r
- https://repo.anaconda.com/pkgs/msys2
从 2024 年 4 月开始,Anaconda 为了合规要求,强制所有使用其默认官方源的用户必须主动同意服务条款。这是"一次性"操作,同意后,你的电脑就会记住这个授权,以后不会再弹出这个提示。
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 tos accept --override-channels --channel https://repo.anaconda.com/pkgs/msys2
使用国内镜像源(推荐):清华大学、中科大等国内镜像站提供了 Anaconda 的完整镜像,可以绕过这个条款限制。配置方法是在终端中执行:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r/ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2/ conda config --set show_channel_urls yes