jupyter导入其他环境:
首先要切换到想要添加的环境中来,比如说【gan】,然后在这个环境中,使用ipykernel的命令来添加环境到jupyter notebook中
conda activate gan
conda install ipykernel
python -m ipykernel install --name gan
执行完这个语句之后,会自动在目录【C:\ProgramData\jupyter\kernels】(类似)生成一个【adda】文件夹,里面有kernel.json文件
现在打开jupyter notebook,里面就会显示有这个虚拟环境了
也可以移除已经有的环境
jupyter kernelspec remove 环境名
jupyter插件
- 安装并激活 jupyter_contrib_nbextensions,
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple flask
#为了快速安装的速度,先临时使用清华的镜像,这样并不会改变默认的pip参数。
pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user
- 安装并启用 Jupyter Nbextensions Configurator
pip install jupyter_nbextensions_configurator
jupyter nbextensions_configurator enable --user
除了实用 pip 安装以外,还可以使用conda进行完成以上两步,命令如下:
conda install -c conda-forge jupyter_contrib_nbextensionsconda install -c
conda-forge jupyter_nbextensions_configurator
安装完成以后,打开 jupyter notebook 可以看到菜单栏多了 :Nbextensions 一栏,这样就可以安装插件了,推荐三个常用的插件:Table of Contents, Variable Inspector 和 ExcecuteTime。
临时镜像
可以在使用pip的时候加参数-i https://pypi.tuna.tsinghua.edu.cn/simple