image-20240922171734028 ## 下载(方法一:conda) ### 第一步、通过Anaconda下载

注:Anadonda内部集成Jupyter和其他数据分析平台

Anaconda | The Operating System for AI](https://www.anaconda.com/)

查看版本

1
jupyter --version

升级

1
2
conda update conda
conda install jupyter

已经开启的jupyter后台需要关了,否则出现占用错误

image-20240922175815951
image-20240922172929719

注:在卡住时敲击回车可以继续

第二步、安装扩展

2024.922,注意到一个现象,安装完扩展后

注:个人经验,没安装扩展时无法显示互动动态图片

%matplotlib notebook使用错误IPython 没有定义

image-20240922183650299

1、卸载之前安装(如有)

1
2
conda uninstall jupyter_contrib_nbextensions
conda uninstall jupyter_nbextensions_configurator
image-20240922184729363

2、重新安装 jupyter_contrib_nbextensions

1
conda install jupyter_contrib_nbextensions
image-20240922235059711

a、搜索位置进行手动安装(跳过,出错 xxx not found时使用)

image-20240922185458594
image-20240922185425315

b、在上图位置(X:-packages_contrib_nbextensions) cmd命令安装py指令(跳过,出错 xxx not found时使用)

1
python application.py install
image-20240922185709709

c、关联CCS和JS

1
2
jupyter contrib-nbextension install --user

3、重新安装 conda uninstall jupyter_nbextensions_configurator

1
conda install jupyter_nbextensions_configurator

启用nbextensions_configurator

1
jupyter nbextensions_configurator enable --user

如果这一步出现xxx is not present ,则使用everything搜索jupyter_nbextension_configurator,模仿2中,使用cmd命令

image-20240922211048639
1
python application.py enable
image-20240922205001308

额外说明:pip与conda的冲突

注:发现pip安装和conda安装的jupyter目录一致,推测是conda安装时写入的环境变量,但是此时从anaconda GUI中无法打开jupyter了,所有pip最好不要与conda混用安装包。出现这个错误的原因可能在于电脑中有多个python,即anaconda内置python和自己的python。查看电脑中python位置shell代码如下

1
where python 
image-20240922180025884

解决方案,重新安装 anaconda3

下载(方法二:pip)

1
pip install notebook --upgrade -i https://pypi.tuna.tsinghua.edu.cn/simple

下载方法三(推荐 ,conda进阶)

使用conda创建虚拟环境env

1
2
3
4
5
6
7
8
9
10
conda create -n your_env_name python=3.8
conda activate your_env_name
conda install notebook=6.4
conda install matplotlib
conda install ipywidgets
conda install spicy
conda install jupyter_contrib_nbextensions
jupyter contrib-nbextension install --user
conda install jupyter_nbextensions_configurator
jupyter nbextensions_configurator enable --user

启动

1
2
conda activate your_env_name
jupyter notebook

image-20240923030545791