jupyter切换内核方法配置问题总结

  1. 下面这个博客总结了3种不同的方法,很有调理,推荐尝试
    【最全指南】如何在 Jupyter Notebook 中切换/使用 conda 虚拟环境?

    !!! 注意使用上面介绍的ipykernel方法2, 要在每一个希望被jupyter识别到的环境内【分别】安装ipykernel以及添加配置 python -m ipykernel install --user --name myenv

    如果只在安装jupyter的环境中执行 python -m ipykernel install --user --name myenv 则会出现在jupyter中看起来有其他kernel,但是其实无法使用的诡异情况

  2. 一样的问题 Conda environments not showing up in Jupyter Notebook
    Conda environments not showing up in Jupyter Notebook

    如果不使用nb_conda的解决说明:

    I don't think the other answers are working any more, as conda stopped automatically setting environments up as jupyter kernels. You need to manually add kernels for each environment in the following way:

    bash 复制代码
    source activate myenv
    pip install ipykernel
    python -m ipykernel install --user --name myenv --display-name "myenv"

    !!! 再说一遍!要在每一个希望被jupyter识别到的环境内【分别】安装ipykernel以及添加配置 python -m ipykernel install --user --name myenv

  3. 报错Jupyter conda tab 'An error occurred while retrieving package information.'可能的解决方案,当使用了nb_conda的时候
    Running Jupyter notebook in a virtualenv: installed sklearn module not available

    bash 复制代码
    rm jupyter_notebook_config.json in ~/.jupyter

    bash 复制代码
    jupyter serverextension disable nb_conda
    jupyter serverextension enable nb_conda
  4. 报错jupyter cannot find my conda env

    You need to install nb_conda, however, at the moment nb-conda cannot be directly installed with python3.6.

    A way around that is to install it from conda-forge:

    bash 复制代码
    conda install -c conda-forge nb_conda
  5. 一旦配置之后,但是又配置错误了,彻底删除jupyter以及所有配置

    bash 复制代码
    jupyter kernelspec list 

    列出所有可用的内核规范,注意这里只是看起来可以用,不代表真的就可以用,将其全部删掉。

    bash 复制代码
    jupyter --paths

    输出 Jupyter 在系统中查找各种文件(包括配置文件)的路径信息。输出结果通常包括config(配置文件路径)、data(数据文件路径)和runtime(运行时文件路径)等部分。将其所有目录全面删掉。

    可以的话,把这个环境变量也删了

    conda remove --name myenv --all

    重新建立一个

    conda create -n myenv python=3.xx

相关推荐
weixin_462446231 天前
Python 使用 openpyxl 从 URL 读取 Excel 并获取 Sheet 及单元格样式信息
python·excel·openpyxl
毕设源码-钟学长1 天前
【开题答辩全过程】以 基于Python的健康食谱规划系统的设计与实现为例,包含答辩的问题和答案
开发语言·python
百***78751 天前
Grok-4.1技术深度解析:双版本架构突破与Python API快速集成指南
大数据·python·架构
2501_942191771 天前
基于YOLO11-HSFPN的数字检测与识别模型实现详解
python
忧郁的橙子.1 天前
26期_01_Pyhton基本语法
python
sunfove1 天前
实战篇:用 Python 徒手实现模拟退火算法解决 TSP 问题
开发语言·python·模拟退火算法
我是菜鸟0713号1 天前
Qt + Python 算法集成的一种低耦合实践:FastAPI 服务化方案
python·qt·fastapi
我是一只小青蛙8881 天前
TraeCNIDE Python开发全流程指南
python
欣然~1 天前
法律案例 PDF 批量转 TXT 工具代码
linux·前端·python
季布,1 天前
本地Windows测试:钉钉群消息/文件传输到Python服务(完整教程)
windows·python·钉钉