简体   繁体   English

IPython和Jupyter qtconsole之间的区别

[英]Difference between IPython and Jupyter qtconsole

I downloaded Anaconda for Windows (Python 2.7). 我下载了Windows版的Anaconda(Python 2.7)。 I created two environments with different packages. 我用不同的软件包创建了两个环境。 If I change the environment and launch IPyhon, all packages are available. 如果我更改环境并启动IPyhon,则所有软件包都可用。 Since I have other problems with IPython, I tried for the first time Jupyter qtconsole. 由于我在使用IPython时遇到其他问题,因此我第一次尝试使用Jupyter qtconsole。 What is the difference between these? 这些有什么区别? I searched for half a day, but I can't find a proper answer. 我搜索了半天,但找不到正确的答案。 Are they related? 他们有关系吗? Is something better/newer/etc.? 有更好/更新/等等的东西吗?

If I try to import eg pandas in Jupyter qtconsole, I get the error message: 如果我尝试在Jupyter qtconsole中导入例如熊猫,则会收到错误消息:

No module named panda

But if I try to install pandas in Jupyter qtconsole: !pip install pandas , I get this error message: 但是,如果我尝试在Jupyter qtconsole中安装熊猫: !pip install pandas ,则会收到以下错误消息:

Requirement already satisfied: pandas in c:\users\...\appdata\local\conda\conda\envs\mpcpy\lib\site-packages

Hope that someone can help me. 希望有人能帮助我。 Thank you 谢谢

As Tim Gottgetreu noted, there is a typo in the word import panda : It must be import pandas as pd . 正如Tim Gottgetreu所指出的, import panda一词中有一个错字:它必须是import pandas as pd I add as pd part, because that is the convention. 我将其添加as pd部分,因为这是约定。

To the main question about the difference between Jupyter iPython and Jupyter Qtconsole: 关于Jupyter iPython和Jupyter Qtconsole之间的区别的主要问题:

1)iPython is an 'enhanced' 'Terminal' vs. Qtconsole is imitating it by design. 1)iPython是一个“增强型”“终端”,而Qtconsole则是通过设计来模仿它。

from the docs: https://qtconsole.readthedocs.io/en/stable/ 来自文档: https : //qtconsole.readthedocs.io/en/stable/

2)Qt console shows docs of objects as a pop-up window, which is very handy. 2)Qt控制台将对象文档显示为弹出窗口,非常方便。 In iPython, I have to use object.__doc__() to read the docs. 在iPython中,我必须使用object.__doc__()来阅读文档。

3)Qt console is good when you work with data and have to plot it, because it already has all the backend drivers loaded and set up within it to support interactive plotting. 3)Qt控制台在您处理数据并必须对其进行绘图时非常有用,因为它已经加载并设置了所有后端驱动程序以支持交互式绘图。 In iPython you have to do this yourself and it is system depended. 在iPython中,您必须自己执行此操作,并且它取决于系统。

4)iPython has been around for longer and has better integration with different outside sources. 4)iPython已经存在很长时间了,并且可以更好地与其他外部资源集成。 QTconsole has some limitations. QTconsole有一些限制。

5) (personal) I get tired staring at the bottom of the screen to type commands and see output. 5)(个人)我讨厌盯着屏幕底部键入命令并查看输出。 In QTconsole I can scroll and bring my cursor line to the level (hight) I want, whilst in iPython I can't do that. 在QTconsole中,我可以滚动并将光标线移到所需水平(高),而在iPython中,我不能这样做。

From what I can gather Jupyter notebook is the next generation of Ipython. 据我所知,Jupyter Notebook是下一代Ipython。 Pandas (and Numpy) both come as standard installs with Anaconda. 熊猫(和Numpy)都是Anaconda的标准安装。 So after you launch Jupyter ! jupyter notebook 因此,启动Jupyter之后! jupyter notebook ! jupyter notebook in the command line, importing pandas and numpy should be straight forward in juptyer notebook. 在命令行中输入! jupyter notebook时,应在juptyer笔记本中直接导入pandas和numpy。 Standard import being 标准导入

import pandas as pd import numpy as np

then run the cell by crtl+enter 然后通过crtl + enter运行单元

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM