我的Jupyter笔记本电脑安装了python 2内核。我不明白为什么。我可能在安装的时候搞砸了。我已经安装了python 3。我怎么能把它加到木星上? 下面是默认的Jupyter使用python3 -m install Jupyter安装并在浏览器中使用Jupyter notebook打开的截图:
当前回答
我也面临着同样的问题。每当我使用以下命令启动jupyter notebook时,我都不会看到创建一个新的Python 3 notebook的选项。
我通过运行以下命令解决了这个问题。
pip install notebook
之后,我开始笔记本与相同的命令之前
jupyter notebook
我能够看到我的主目录并创建新的python3笔记本。
其他回答
使用Python2获得ipython笔记本(在Windows7上) 用pip install -U Jupyter升级到Jupyter 安装Python3 使用pip3 install Jupyter再次安装Jupyter 使用ipython3 kernelspec install-self安装Python3内核 我终于有两个工作的玉米粒了。
Here's a Windows/non command line method I found, which worked for me: Find the folder where the kernel files are stored (on my machine - C:\ProgramData\jupyter\kernels - note that ProgramData is a hidden folder), create a copy of the existing kernel's folder, change the name and edit the json file within to point to the new kernel's directory. In this json you can also edit the kernel name that is displayed in ipython (e.g. instead of just python 2 you can specify 2.7.9 if you need to further distinguish for some reason).
当你使用conda管理你的python envs时,遵循以下两个步骤:
激活py3(在Windows上或在Linux上激活py3) Conda install notebook ipykernel或者直接使用Conda install jupyter
我用以下命令成功地在macOS El Capitan (ipython版本:4.1.0)上安装了python3内核。
python3 -m pip install ipykernel
python3 -m ipykernel install --user
你可以在jupyter kernelspec列表中看到所有已安装的内核。
更多信息可以在这里找到
解决方案在官方文档中有详细的说明:https://ipython.readthedocs.org/en/latest/install/kernel_install.html
我尝试了第一种方法。因为我已经安装了ipykernel,简单地运行python3 -m ipykernel install——user就解决了这个问题。
推荐文章
- 当试图运行Python脚本时,“ImportError:没有命名模块”
- 如何阅读一个。xlsx文件使用熊猫库在iPython?
- 检查pandas数据框架索引中是否存在值
- Ipython笔记本清除单元格输出代码
- tqdm在Jupyter笔记本重复打印新的进度条
- 折叠单元在jupyter笔记本
- 如何知道哪个Python在Jupyter笔记本上运行?
- 使用Python 3在Jupyter Notebook中使用相对导入从位于另一个目录中的模块导入本地函数
- 如何嵌入HTML到IPython输出?
- Python和IPython的区别是什么?
- 如何从终端运行。ipynb Jupyter Notebook ?
- 移除jupyter笔记本上的内核
- 如何使用列的格式字符串显示浮动的熊猫数据帧?
- 使用Python 2。3. Python。IPython Notebook中的x
- 如何加载/编辑/运行/保存文本文件(.py)到IPython笔记本细胞?