【Anaconda】Jupyter Notebook报错:500 internal server error解决办法

基础环境:MacOS m1、python=3.9、tsinghua镜像源
前情提要:我在Jupyter Lab激活了我所在的虚拟环境(name=pytorch),但我改动.ipynb文件的代码是从本地环境(name=root)打开的Jupyter Notebook里完成的,root环境缺乏我在pytorch环境里安装好的包。然而pytorch环境事先没有安装Jupyter Notebook,所以打算在终端进行安装,在终端输入pip install jupyter后再输入jupyter notebook启动,在打开.ipynb文件想要编辑时,显示500 internal server error
问题分析:500开头的问题属于服务器内部,最开始分析是否为环境依赖冲突,在CSDN搜索后使用以下方式,问题解决,jupyter notebook正常运行
解决过程

  1. 在需要解决的虚拟环境pytorch里卸载nbconvert包:pip uninstall nbconvert
  2. 打算重新安装nbconvert包,终端报错,显示我当前缺少qtconsole环境,qtconsole是Jupyter的Qt控制台,需要安装:pip install qtconsole
  3. 再次安装nbconvert包:pip install nbconvert
  4. 重启pytorch环境Jupyter Notebook,打开.ipynb文件,页面正常显示。

猜你喜欢

转载自blog.csdn.net/weixin_45942927/article/details/132741214