【问题标题】:Jupyter Notebook uses my system's python3.4 instead of anaconda's python3.5 as a kernelJupyter Notebook 使用我系统的 python3.4 而不是 anaconda 的 python3.5 作为内核
【发布时间】:2016-10-05 04:19:28
【问题描述】:

我安装了 anaconda2,并手动添加了 python3 内核,所以我可以在 python2 和 python3 之间进行选择。问题是我添加了系统的 python3 二进制文件,而不是 anaconda 的,所以我错过了 anaconda 带来的所有库。具体来说,我无法导入'from scipy.misc import imread'。

所以我删除了anaconda2,安装了anaconda3,但是我的jupyter notebook仍然使用我系统的旧python3内核。当我在 jupyter notebook 中运行 sys.version 时,我得到了 python 3.4,但是当我在控制台中的 ipython 中运行它时,我得到了 python 3.5,以及我需要的所有模块。

那么我如何具体告诉 jupyter notebook 使用什么 bin 作为内核呢?

【问题讨论】:

  • ls $(jupyter --data-dir)/kernels 打印什么?
  • @cel ls: 无法访问 /home/ubuntu/.local/share/jupyter/kernels: 没有这样的文件或目录
  • which -a jupyter 是我要检查的下一个

标签: python ipython jupyter


【解决方案1】:

最终解决了这个问题:

pip install -U ipython

ipython3 kernelspec install-self

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-11
    • 1970-01-01
    • 2020-08-01
    • 2021-02-13
    • 1970-01-01
    • 2021-09-28
    相关资源
    最近更新 更多