You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

无法在Jupyter中新建Python3文件,求重置环境恢复默认选项

彻底卸载Jupyter并重置环境配置

一、完全清理Jupyter相关组件

  1. 卸载所有Jupyter关联包
    • 若曾用pip安装:
      pip uninstall -y jupyter jupyter_core jupyter-client jupyter-console ipython ipykernel ipywidgets nbconvert nbformat notebook qtconsole traitlets
      
    • 若曾用conda安装:
      conda remove -y jupyter jupyter_core jupyter-client jupyter-console ipython ipykernel ipywidgets nbconvert nbformat notebook qtconsole traitlets
      
  2. 删除Jupyter配置与缓存目录
    rm -rf ~/.jupyter
    rm -rf ~/.local/share/jupyter
    rm -rf ~/.cache/jupyter
    
  3. 移除多余内核配置
    先查看所有已注册内核,再删除误创建的conda环境内核:
    # 列出所有内核路径
    jupyter kernelspec list
    # 删除指定内核(替换为你的误创建环境名)
    jupyter kernelspec remove [你的误创建环境名]
    

二、重新安装并配置目标环境

  1. 确保系统Python3为brew安装的版本
    brew install python3
    
  2. 给Python3注册Jupyter内核
    python3 -m pip install ipykernel
    python3 -m ipykernel install --user --name python3 --display-name "Python 3"
    
  3. 重新安装Jupyter
    python3 -m pip install jupyter
    

三、验证效果

启动Jupyter Notebook:

jupyter notebook

点击「新建」选项,此时应仅显示Python 2和Python 3的可选内核。

内容的提问来源于stack exchange,提问作者Lusian

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.08 17:07:04