用python 3运行Jupyter笔记本(Running Jupyter notebook with python 3)

编程入门 行业动态 更新时间:2024-10-23 04:44:06
用python 3运行Jupyter笔记本(Running Jupyter notebook with python 3)

所以我安装了最新版本的Anaconda,然后用python 3创建了一个环境。为了确保python 3实际上是我认识的人,我首先激活了环境,然后在下面输入python就是我得到的

Python 3.5.3 |Continuum Analytics, Inc.| (default, Feb 22 2017, 21:28:42) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

所以,现在我确定我已经有了python 3,但我试图运行Jupyter Notebook但它似乎只有一个python 2内核。 内核甚至没有链接到特定的环境,如下图所示

我如何添加python3内核? 为什么不首先承认它?

So I installed the latest version of Anaconda, then created an environment with python 3. To ensure that python 3 is actually the one recognized I first activated the environment then typed python below is what I got

Python 3.5.3 |Continuum Analytics, Inc.| (default, Feb 22 2017, 21:28:42) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

So now that I made sure I already have python 3, I tried to run Jupyter Notebook however it seems to only have a python 2 kernel. And the kernel is not even linked to a specific environment as show in the image below

How can I add python3 kernel ? and why was not it recognized in the first place ?

最满意答案

我曾经有过同样的问题。 我最终用pip3安装了jupyter以获取python3内核。

OK, thanks everyone for answering but my issue was a little different. When creating my environment I did not add the anaconda option

So instead of

$ conda create -n py35 python=3.5 anaconda

I used

$ conda create -n py35 python=3.5

According to this conda documentation, the anaconda option is

the meta-package that includes all of the actual Python packages comprising the Anaconda distribution

Still I could not relate why missing that option will not install python 3 kernel for Jupyter Notebook.

更多推荐

本文发布于:2023-07-08 20:04:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1080276.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:笔记本   Jupyter   python   Running   notebook

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!