3

In a Jupyter notebook, a "cell magic" command (prefixed with two percent signs) ends at the end of the cell and is automatically invoked:

%%timeit in Jupyter notebook

But if I try the same thing in the Jupyter console, the command never ends, after any number of blank lines:

enter image description here

That only happens if I invoke IPython as jupyter console, though. If I invoke IPython directly as ipython, the cell magic command completes after one blank line:

enter image description here

For each example, the versions of Python and IPython are identical: Python 3.5.2 and IPython 6.1.0 on one machine (installed with pip), Python 3.4.5 and IPython 5.1.0 on another (installed with Conda).

Is this a bug? Or is there Jupyter default configuration somewhere for IPython that differs from IPython's own default configuration?

1 Answer 1

4

Yes, it is a bug, the cell magics are suppose to ends after 2 new lines. The Jupyter console is way under maintained – we are not aware of many people using it, and it has plenty of issues.

Technically I believe the jupyter console does not use (or respect) the "is_complete" message from the protocol that should tell it wether the snippet of code should be executed or if a newline should be inserted.

You can try to open a bug report, but the fix will probably not be implemented quickly unless someone does a PR.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.