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

Anaconda Prompt启动Jupyter Notebook失败及certifi导入错误求助

解决方案

问题1:启动Jupyter Notebook时出现ImportError: cannot import name 'where' from 'certifi'

解决步骤:

  1. 激活finance虚拟环境:
    conda activate finance
    
  2. 卸载当前损坏或版本不兼容的certifi包:
    pip uninstall -y certifi
    
    若使用conda管理依赖,执行:
    conda remove certifi
    
  3. 重新安装稳定兼容版本的certifi:
    pip install certifi==2023.7.22
    
    或通过conda安装:
    conda install certifi
    
  4. 再次尝试启动Jupyter Notebook:
    jupyter notebook
    

问题2:安装jupyter_contrib_nbextensions时事务回滚,出现ModuleNotFoundError: No module named 'notebook.nbextensions'

解决步骤:

方案A:修复现有环境依赖

  1. 确保finance环境中已正确安装notebook:
    conda activate finance
    conda install notebook
    
  2. 先安装依赖核心包,再安装nbextensions:
    conda install -c conda-forge jupyter_contrib_core
    conda install -c conda-forge jupyter_contrib_nbextensions
    
  3. 若conda安装失败,尝试用pip安装并配置:
    pip install jupyter_contrib_nbextensions
    jupyter contrib nbextension install --user
    

方案B:重新创建干净环境(推荐,避免依赖混乱)

  1. 删除现有finance环境:
    conda remove -n finance --all
    
  2. 重新创建指定Python版本的环境(匹配原环境的3.8版本),并预装notebook:
    conda create -n finance python=3.8 notebook
    
  3. 激活环境后安装所需业务库及nbextensions:
    conda activate finance
    # 安装你的其他业务依赖库
    conda install -c conda-forge jupyter_contrib_nbextensions
    

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.15 06:02:29