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

相关推荐
java1234_小锋12 分钟前
TensorFlow2 Python深度学习 - 深度学习概述
python·深度学习·tensorflow·tensorflow2·python深度学习
迈火1 小时前
PuLID_ComfyUI:ComfyUI中的图像生成强化插件
开发语言·人工智能·python·深度学习·计算机视觉·stable diffusion·语音识别
浔川python社3 小时前
《网络爬虫技术规范与应用指南系列》(xc—5)完
爬虫·python
MongoVIP4 小时前
Scrapy爬虫实战:正则高效解析豆瓣电影
python·scrapy
李小白664 小时前
Python文件操作
开发语言·python
weixin_525936335 小时前
金融大数据处理与分析
hadoop·python·hdfs·金融·数据分析·spark·matplotlib
Zwb2997925 小时前
Day 30 - 错误、异常与 JSON 数据 - Python学习笔记
笔记·python·学习·json
码界筑梦坊6 小时前
206-基于深度学习的胸部CT肺癌诊断项目的设计与实现
人工智能·python·深度学习·flask·毕业设计
flashlight_hi7 小时前
LeetCode 分类刷题:74. 搜索二维矩阵
python·算法·leetcode·矩阵
通往曙光的路上7 小时前
国庆回来的css
人工智能·python·tensorflow