Code Monkey home page Code Monkey logo

jupyter_console's Introduction

Jupyter Console

Build Status Documentation Status

A terminal-based console frontend for Jupyter kernels. This code is based on the single-process IPython terminal.

Install with pip:

pip install jupyter-console

Install with conda:

conda install -c conda-forge jupyter_console

Start:

jupyter console

Help:

jupyter console -h

Jupyter Console allows for console-based interaction with non-python Jupyter kernels such as IJulia, IRKernel.

To start the console with a particular kernel, ask for it by name::

jupyter console --kernel=julia-0.4

A list of available kernels can be seen with::

jupyter kernelspec list

Release build:

$ pip install pep517
$ python -m pep517.build .

Resources

About the Jupyter Development Team

The Jupyter Development Team is the set of all contributors to the Jupyter project. This includes all of the Jupyter subprojects.

The core team that coordinates development on GitHub can be found here: https://github.com/jupyter/.

Our Copyright Policy

Jupyter uses a shared copyright model. Each contributor maintains copyright over their contributions to Jupyter. But, it is important to note that these contributions are typically only changes to the repositories. Thus, the Jupyter source code, in its entirety is not the copyright of any single person or institution. Instead, it is the collective copyright of the entire Jupyter Development Team. If individual contributors want to maintain a record of what changes/contributions they have specific copyright on, they should indicate their copyright in the commit message of the change, when they commit the change to one of the Jupyter repositories.

With this in mind, the following banner should be used in any source code file to indicate the copyright and license terms:

# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.

jupyter_console's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jupyter_console's Issues

BUG: Resource temporarily unavailable

Related ipython/ipython#7122
Related ipython/ipykernel#79

I tried to reproduce this issue ( ipython/ipython#7122 ) using jupyter console. However, I got this other unrelated issue instead.

Environment details.

# packages in environment at /zopt/conda/envs/ipy:
#
appnope                   0.1.0                    py27_0    defaults
decorator                 4.0.4                    py27_0    defaults
ipykernel                 4.1.1                    py27_0    defaults
ipython                   4.0.0                    py27_1    defaults
ipython-genutils          0.1.0                     <pip>
ipython_genutils          0.1.0                    py27_0    defaults
jupyter-client            4.1.1                     <pip>
jupyter-console           4.0.3                     <pip>
jupyter-core              4.0.6                     <pip>
jupyter_client            4.1.1                    py27_0    defaults
jupyter_console           4.0.3                    py27_0    defaults
jupyter_core              4.0.6                    py27_0    defaults
numpy                     1.10.1                   py27_0    defaults
openssl                   1.0.2d                        0    defaults
path.py                   8.1.2                    py27_0    defaults
pexpect                   3.3                      py27_0    defaults
pickleshare               0.5                      py27_0    defaults
pip                       7.1.2                    py27_0    defaults
python                    2.7.10                        2    defaults
python.app                1.2                      py27_4    defaults
pyzmq                     14.7.0                   py27_1    defaults
readline                  6.2                           2    <unknown>
setuptools                18.4                     py27_0    defaults
simplegeneric             0.8.1                    py27_0    defaults
sqlite                    3.8.4.1                       1    <unknown>
tk                        8.5.18                        0    <unknown>
traitlets                 4.0.0                    py27_0    defaults
wheel                     0.26.0                   py27_1    defaults
zeromq                    4.1.3                         0    defaults
zlib                      1.2.8                         0    <unknown>

Here's what happened.

$ jupyter console
Jupyter Console 4.0.3

[ZMQTerminalIPythonApp] Loading IPython extension: storemagic
[ZMQTerminalIPythonApp] Loading IPython extension: h5py.ipy_completer

In [1]: from ipykernel.datapub import publish_data

In [2]: import numpy as np

In [3]: myarr = np.ones(2 * 1024 * 1024 * 1024 * 8 // 64)

In [4]: publish_data({'x': myarr})
Traceback (most recent call last):
  File "/zopt/conda/envs/nanshenv/bin/jupyter-console", line 5, in <module>
    app.main()
  File "/zopt/conda/envs/nanshenv/lib/python2.7/site-packages/jupyter_core/application.py", line 267, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/zopt/conda/envs/nanshenv/lib/python2.7/site-packages/traitlets/config/application.py", line 592, in launch_instance
    app.start()
  File "/zopt/conda/envs/nanshenv/lib/python2.7/site-packages/jupyter_console/app.py", line 155, in start
    super(ZMQTerminalIPythonApp, self).start()
  File "/zopt/conda/envs/nanshenv/lib/python2.7/site-packages/IPython/terminal/ipapp.py", line 353, in start
    self.shell.mainloop()
  File "/zopt/conda/envs/nanshenv/lib/python2.7/site-packages/jupyter_console/interactiveshell.py", line 420, in mainloop
    self.interact(display_banner=display_banner)
  File "/zopt/conda/envs/nanshenv/lib/python2.7/site-packages/jupyter_console/interactiveshell.py", line 588, in interact
    self.run_cell(source_raw)
  File "/zopt/conda/envs/nanshenv/lib/python2.7/site-packages/jupyter_console/interactiveshell.py", line 174, in run_cell
    self.handle_iopub(msg_id)
  File "/zopt/conda/envs/nanshenv/lib/python2.7/site-packages/jupyter_console/interactiveshell.py", line 262, in handle_iopub
    sub_msg = self.client.iopub_channel.get_msg()
  File "/zopt/conda/envs/nanshenv/lib/python2.7/site-packages/jupyter_client/blocking/channels.py", line 55, in get_msg
    return self._recv()
  File "/zopt/conda/envs/nanshenv/lib/python2.7/site-packages/jupyter_client/blocking/channels.py", line 41, in _recv
    msg = self.socket.recv_multipart(**kwargs)
  File "/zopt/conda/envs/nanshenv/lib/python2.7/site-packages/zmq/sugar/socket.py", line 361, in recv_multipart
    part = self.recv(flags, copy=copy, track=track)
  File "zmq/backend/cython/socket.pyx", line 676, in zmq.backend.cython.socket.Socket.recv (zmq/backend/cython/socket.c:6507)
  File "zmq/backend/cython/socket.pyx", line 710, in zmq.backend.cython.socket.Socket.recv (zmq/backend/cython/socket.c:6307)
  File "zmq/backend/cython/socket.pyx", line 147, in zmq.backend.cython.socket._recv_copy (zmq/backend/cython/socket.c:1877)
  File "zmq/backend/cython/checkrc.pxd", line 19, in zmq.backend.cython.checkrc._check_rc (zmq/backend/cython/socket.c:6920)
    raise Again(errno)
Again: Resource temporarily unavailable

If you suspect this is an IPython bug, please report it at:
    https://github.com/ipython/ipython/issues
or send an email to the mailing list at [email protected]

You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
    %config Application.verbose_crash=True

%reset hang

Calling two times the %reset magic cause the kernel to hang

segfault after KeyboardInterrupt

I don't know how useful this bug report is, since it'll be hard for someone else to reproduce.
I keep getting segfaults when running a memory and compute intensive program (deep learning) in ipython 4.0.1, and pressing ^C in a loop:

KeyboardInterrupt:

In [3]: [1]    18011 segmentation fault  ipython-2.7 --pylab

It usually happens doing a Keras (Theano) run, so I'm not plotting anything at that moment.

Jupyter console not usable on Windows

On Windows, jupyter console is not usable, because it is 'not blocking the command prompt'. This is a similar issue as jupyter/notebook#367. But, where the issue is not critical for the notebook, it makes the console just unusable.

Small illustration:

capture1

At the moment I type x, it returns to the command prompt, where x is not defined.

While typing, the cursor randomly switches between the jupyter prompt and the normal command prompt.

Exit from console without shutting down kernel

Supposed I open a new console using existing kernel by running:
jupyter console --existing

If I type exit or quit, both console and kernel terminate. Is it possible to exit from that new console without shutting down the existing kernel? Thanks.

Add conda install instructions to README

The command to install on conda is:

conda install jupyter_console

Do we want to add this to the README?

Also, for what specific use cases do people use jupyter console? Command line interface to difference language kernels (i.e. iRkernel)

Documented option for autoindent wrong

The documentation on readthedocs explains the following config option for the console:

InteractiveShell.autoindent : CBool

I do not even have InteractiveShell as a config object in jupyter console 4.0.3. What exists is ZMQInteractiveShell. In that object, autoindent exists, is set to False and still the shell auto-indents.

Empty tuple printed at startup on Python 2

When starting up the console on Python 2, there is an empty tuple. This is not present on Python 3. Likely due to some missing from __future__ import print_function and a call like print().

$ jupyter console 
Jupyter Console 4.1.0
()

In [1]:

Details from conda.

$ conda list
# packages in environment at /zopt/conda2/envs/python2:
#
appnope                   0.1.0                    py27_0    defaults
backports-abc             0.4                       <pip>
backports.ssl-match-hostname 3.4.0.2                   <pip>
backports_abc             0.4                      py27_0    defaults
decorator                 4.0.9                    py27_0    defaults
ipykernel                 4.3.1                    py27_0    defaults
ipython                   4.1.2                    py27_0    defaults
ipython-genutils          0.1.0                     <pip>
ipython_genutils          0.1.0                    py27_0    defaults
jupyter-client            4.1.1                     <pip>
jupyter-console           4.1.0                     <pip>
jupyter-core              4.0.6                     <pip>
jupyter_client            4.1.1                    py27_0    defaults
jupyter_console           4.1.0                    py27_0    defaults
jupyter_core              4.0.6                    py27_0    defaults
openssl                   1.0.2g                        0    defaults
path.py                   8.1.2                    py27_1    defaults
pexpect                   3.3                      py27_0    defaults
pickleshare               0.5                      py27_0    defaults
pip                       8.0.3                    py27_0    defaults
python                    2.7.11                        0    defaults
python.app                1.2                      py27_4    defaults
pyzmq                     15.2.0                   py27_0    defaults
readline                  6.2                           2    defaults
setuptools                20.1.1                   py27_0    defaults
simplegeneric             0.8.1                    py27_0    defaults
singledispatch            3.4.0.3                  py27_0    defaults
six                       1.10.0                   py27_0    defaults
sqlite                    3.9.2                         0    defaults
ssl_match_hostname        3.4.0.2                  py27_0    defaults
tk                        8.5.18                        0    defaults
tornado                   4.3                      py27_0    defaults
traitlets                 4.1.0                    py27_0    defaults
wheel                     0.29.0                   py27_0    defaults
zlib                      1.2.8                         0    defaults

Install kernelspec on first `jupyter console`?

Installing just this repository (assume cloned)

pip install -r requirements.txt -e .

and trying to run

jupyter console

when you don't have any kernels ends up not being able to find the default kernel.

Should this install the kernelspec on first run?

If there's an issue that it would be installing a default, well jupyter console does launch the IPython kernel by default.

Crash with empty imput cells

This seems to happen

In [2]:                                                                                     
Traceback (most recent call last):
  File "/home/mniekerk/miniconda3/envs/lab/bin/jupyter-console", line 6, in <module>
    sys.exit(jupyter_console.app.main())
  File "/home/mniekerk/miniconda3/envs/lab/lib/python3.5/site-packages/jupyter_core/application.py", line 267, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/home/mniekerk/miniconda3/envs/lab/lib/python3.5/site-packages/traitlets/config/application.py", line 596, in launch_instance
    app.start()
  File "/home/mniekerk/miniconda3/envs/lab/lib/python3.5/site-packages/jupyter_console/app.py", line 151, in start
    self.shell.mainloop()
  File "/home/mniekerk/miniconda3/envs/lab/lib/python3.5/site-packages/jupyter_console/ptshell.py", line 463, in mainloop
    self.interact()
  File "/home/mniekerk/miniconda3/envs/lab/lib/python3.5/site-packages/jupyter_console/ptshell.py", line 448, in interact
    code = self.prompt_for_code()
  File "/home/mniekerk/miniconda3/envs/lab/lib/python3.5/site-packages/jupyter_console/ptshell.py", line 408, in prompt_for_code
    reset_current_buffer=True)
  File "/home/mniekerk/miniconda3/envs/lab/lib/python3.5/site-packages/prompt_toolkit/interface.py", line 389, in run
    self.eventloop.run(self.input, self.create_eventloop_callbacks())
  File "/home/mniekerk/miniconda3/envs/lab/lib/python3.5/site-packages/prompt_toolkit/eventloop/posix.py", line 154, in run
    t()
  File "/home/mniekerk/miniconda3/envs/lab/lib/python3.5/site-packages/prompt_toolkit/eventloop/posix.py", line 82, in read_from_stdin
    inputstream.feed(data)
  File "/home/mniekerk/miniconda3/envs/lab/lib/python3.5/site-packages/prompt_toolkit/terminal/vt100_input.py", line 376, in feed
    self._input_parser.send(c)
  File "/home/mniekerk/miniconda3/envs/lab/lib/python3.5/site-packages/prompt_toolkit/terminal/vt100_input.py", line 295, in _input_parser_generator
    self._call_handler(match, prefix)
  File "/home/mniekerk/miniconda3/envs/lab/lib/python3.5/site-packages/prompt_toolkit/terminal/vt100_input.py", line 328, in _call_handler
    self.feed_key_callback(KeyPress(key, insert_text))
  File "/home/mniekerk/miniconda3/envs/lab/lib/python3.5/site-packages/prompt_toolkit/interface.py", line 1006, in feed_key
    cli.input_processor.process_keys()
  File "/home/mniekerk/miniconda3/envs/lab/lib/python3.5/site-packages/prompt_toolkit/key_binding/input_processor.py", line 201, in process_keys
    self._process_coroutine.send(key_press)
  File "/home/mniekerk/miniconda3/envs/lab/lib/python3.5/site-packages/prompt_toolkit/key_binding/input_processor.py", line 158, in _process
    self._call_handler(matches[-1], key_sequence=buffer)
  File "/home/mniekerk/miniconda3/envs/lab/lib/python3.5/site-packages/prompt_toolkit/key_binding/input_processor.py", line 228, in _call_handler
    handler.call(event)
  File "/home/mniekerk/miniconda3/envs/lab/lib/python3.5/site-packages/prompt_toolkit/key_binding/registry.py", line 31, in call
    return self.handler(event)
  File "/home/mniekerk/miniconda3/envs/lab/lib/python3.5/site-packages/jupyter_console/ptshell.py", line 342, in _
    more, indent = self.check_complete(d.text)
  File "/home/mniekerk/miniconda3/envs/lab/lib/python3.5/site-packages/jupyter_console/ptshell.py", line 426, in check_complete
    more = (code.splitlines()[-1] != "")
IndexError: list index out of range

AttributeError: module 'IPython.utils.rlineimpl' has no attribute 'set_completer_delims'

> jupyter console                                                                          
WARNING: Readline services not available or not loaded.                                    
Traceback (most recent call last):                                                         
  File "c:\program files\python 3.5\lib\runpy.py", line 170, in _run_module_as_main        
    "__main__", mod_spec)                                                                  
  File "c:\program files\python 3.5\lib\runpy.py", line 85, in _run_code                   
    exec(code, run_globals)                                                                
  File "C:\Program Files\Python 3.5\Scripts\jupyter-console.exe\__main__.py", line 9, in <m
odule>                                                                                     
    sys.exit(main())                                                                       
  File "c:\program files\python 3.5\lib\site-packages\jupyter_core\application.py", line 26
7, in launch_instance                                                                      
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)                     
  File "c:\program files\python 3.5\lib\site-packages\traitlets\config\application.py", lin
e 591, in launch_instance                                                                  
    app.initialize(argv)                                                                   
  File "c:\program files\python 3.5\lib\site-packages\jupyter_console\app.py", line 144, in
 initialize                                                                                
    super(ZMQTerminalIPythonApp, self).initialize(argv)                                    
  File "<decorator-gen-112>", line 2, in initialize                                        
  File "c:\program files\python 3.5\lib\site-packages\traitlets\config\application.py", lin
e 75, in catch_config_error                                                                
    return method(app, *args, **kwargs)                                                    
  File "c:\program files\python 3.5\lib\site-packages\IPython\terminal\ipapp.py", line 314,
 in initialize                                                                             
    self.init_shell()                                                                      
  File "c:\program files\python 3.5\lib\site-packages\jupyter_console\app.py", line 117, in
 init_shell                                                                                
    client=self.kernel_client,                                                             
  File "c:\program files\python 3.5\lib\site-packages\traitlets\config\configurable.py", li
ne 380, in instance                                                                        
    inst = cls(*args, **kwargs)                                                            
  File "c:\program files\python 3.5\lib\site-packages\IPython\core\interactiveshell.py", li
ne 543, in __init__                                                                        
    self.init_completer()                                                                  
  File "c:\program files\python 3.5\lib\site-packages\jupyter_console\interactiveshell.py",
 line 129, in init_completer                                                               
    self.Completer = ZMQCompleter(self, self.client, config=self.config)                   
  File "c:\program files\python 3.5\lib\site-packages\jupyter_console\completer.py", line 3
7, in __init__                                                                             
    self.readline.set_completer_delims('\r\n')                                             
AttributeError: module 'IPython.utils.rlineimpl' has no attribute 'set_completer_delims'   

If you suspect this is an IPython bug, please report it at:                                
    https://github.com/ipython/ipython/issues                                              
or send an email to the mailing list at [email protected]                              

You can print a more detailed traceback right now with "%tb", or use "%debug"              
to interactively debug it.                                                                 

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:                   
    c.Application.verbose_crash=True                                                       

==============================================================================

> pip3 list                                    
decorator (4.0.6)                              
ipykernel (4.2.1)                              
ipython (4.0.1)                                
ipython-genutils (0.1.0)                       
ipywidgets (4.1.1)                             
Jinja2 (2.8)                                   
jsonschema (2.5.1)                             
jupyter (1.0.0)                                
jupyter-client (4.1.1)                         
jupyter-console (4.0.3)                        
jupyter-core (4.0.6)                           
MarkupSafe (0.23)                              
mistune (0.7.1)                                
nbconvert (4.1.0)                              
nbformat (4.0.1)                               
notebook (4.0.6)                               
path.py (8.1.2)                                
pickleshare (0.5)                              
pip (7.1.2)                                    
Pygments (2.0.2)                               
pyzmq (15.1.0)                                 
qtconsole (4.1.1)                              
setuptools (18.7.1)                            
simplegeneric (0.8.1)                          
tornado (4.3)                                  
traitlets (4.0.0)                              

Running `vignette()` in R crashes the console

c:\data\external\R
λ jupyter console --kernel ir33
Jupyter Console 4.1.1
[...]
In [4]: vignette()

Traceback (most recent call last):
  File "C:\portabel\miniconda\Scripts\jupyter-console-script.py", line 4, in <module>
    app.main()
  File "C:\portabel\miniconda\lib\site-packages\jupyter_core\application.py", line 267, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "C:\portabel\miniconda\lib\site-packages\traitlets\config\application.py", line 596, in launch_instance
    app.start()
  File "C:\portabel\miniconda\lib\site-packages\jupyter_console\app.py", line 152, in start
    self.shell.mainloop()
  File "C:\portabel\miniconda\lib\site-packages\jupyter_console\interactiveshell.py", line 483, in mainloop
    self.interact(display_banner=display_banner)
  File "C:\portabel\miniconda\lib\site-packages\jupyter_console\interactiveshell.py", line 659, in interact
    self.run_cell(source_raw)
  File "C:\portabel\miniconda\lib\site-packages\jupyter_console\interactiveshell.py", line 203, in run_cell
    self.handle_execute_reply(msg_id, timeout=0.05)
  File "C:\portabel\miniconda\lib\site-packages\jupyter_console\interactiveshell.py", line 231, in handle_execute_reply
    page.page(item['data']['text/plain'])
KeyError: 'data'

The notebook shows nothing (which is currently expected as we don#t have proper reprs installed for that)

Add support for vi type interaction

Am i wrong or there is no support for vi commands in ipython and jupyter?
Is it the right project to request this feature improvement?

Rational of the request

vi, vim and gvim are well known text editors used by a large community of developers. The use of different interacting mode and the large set of flexible and powerful shortcuts make it a very efficient tool for developers.

The ability to use vi commands in jupyter would be very attractive for vi-type-editor users and could dramatically increase the power of ipython/jupyter.

console history not working

The history of commands in jupyter console is not working as expected.

As soon as the user leave the start folder, the history appears to be lost. How to reproduce:

python console
#ctrl+R show up the history
cd /tmp
#ctrl+r do not show history anymore

as expected, running ipython without the console option do not raise this problem.

local kernel

→ ipython --version
4.0.1
→ python3 --version
Python 3.5.1
→ jupyter-console --version
4.1.0.dev

jupyter console will not open

Was hoping to try out the console, but it does not appear to run in its current state.

$ sudo pip3 install -U jupyter_console
Requirement already up-to-date: jupyter-console in /usr/local/lib/python3.4/dist-packages
Cleaning up...
$ jupyter console
Traceback (most recent call last):
  File "/usr/local/bin/jupyter-console", line 2, in <module>
    from jupyter_console import app
  File "/usr/local/lib/python3.4/dist-packages/jupyter_console/app.py", line 70, in <module>
    class ZMQTerminalIPythonApp(TerminalIPythonApp, JupyterApp, JupyterConsoleApp):
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases

If it matters, I currently also have ipython installed (at 3.2.1). Everything else is completely updated though.

jupyter console does not look for configuration files in user directory (but in current one)

If you run

$ echo 'exit' | jupyter console --debug 2>&1 | grep $HOME/.jupyter

you get no output (if you grep .ipython it turns out that those are searched, instead). On the other hand, as an example of correct output, if you run

$ jupyter notebook --debug 2>&1 | grep $HOME/.jupyter

you get as output something like

[D 19:21:30.633 NotebookApp] Searching [u'/Users/santini', '/Users/santini/.jupyter', '/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/etc/jupyter', '/usr/local/etc/jupyter', '/etc/jupyter'] for config files
[D 19:21:30.634 NotebookApp] Attempting to load config file jupyter_config.py in path /Users/santini/.jupyter
[D 19:21:30.634 NotebookApp] Attempting to load config file jupyter_config.json in path /Users/santini/.jupyter
[D 19:21:30.634 NotebookApp] Attempting to load config file jupyter_notebook_config.py in path /Users/santini/.jupyter
[D 19:21:30.634 NotebookApp] Attempting to load config file jupyter_notebook_config.json in path /Users/santini/.jupyter

I'm using

$ jupyter --version
4.0.6
$ jupyter console --version
4.0.3

Please add ipython %cpaste magic

I am using vim-slime to send things to ipython. Now I'd like to transition this approach to jupyter console, but the %cpaste magic is missing here.

Autoindentation not working

We switched to use the is_complete messages to determine when to execute input (#35). These messages also give a suggested indentation level for the next line of input, but we don't actually wire that up to adding the indentation at the prompt.

Ping @dsblank

do not exit if owning kernel

I just thing this is the right away to handle.

If the user start a kernel with jupyter-console and try to exit but keeping the kernel by using:

exit(keep_kernel=True)

The following msg is raised:

owning kernel, cannot keep it alive

and the console is closed! If we cant keep it alive I believe the user should be redirected to the console again instead of closing it and losing everything. If we know after the command that the kernel cannot be kept, the user can act (say saving stuff) and exiting or not exiting at all until he is fine with that.

No lexer found in jupyter console

As reported by @asmeurer in xonsh/xonsh#1440, the following will inescapably hang:

$jupyter console --kernel xonsh
/Users/aaronmeurer/anaconda3/envs/ipython5/lib/python3.5/site-packages/jupyter_console/ptshell.py:94: UserWarning: No lexer found for language 'xonsh'. Treating as plain text.
  warn("No lexer found for language %r. Treating as plain text." % name)
Jupyter console 5.0.0

Xonsh - the Python-ish, BASHwards-looking shell


In [1]:

It is not clear whose fault this is but the notebook with a xonsh kernel works just fine. Thus I am reasonably sure that xonsh kernel hook is well-formed. I can replicate this issue on my machine too.

console does not display text/plain alternative for display_data?

The R kernel sends plots via display_data messages and includes a text/plain representation in the message bundle. Unfortunately, it seems that the console does not display the text/plain message:

[ipython-notebook] λ jupyter console --kernel=ir32
Jupyter Console 4.0.3

[ZMQTerminalIPythonApp] Loading IPython extension: storemagic

In [1]: plot(1:10)

In [2]:

The message bundle looks like this:

List of 3
 $ text/plain   : chr "plot without title"
 $ image/png    : raw [1:12628] 89 50 4e 47 ...
 $ image/svg+xml: chr "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlin"| __truncated__

This is IRkernel/IRkernel#262

Config file option for confirm-exit/no-confirm-exit

Noticed that these options were listed under jupyter console --help. Would be nice if there was a way to set the default value for these in the config file. A simple boolean that serves both would work. If there already is a way to do this in the config file, it would be nice if that was added to this help string somehow (like what variable to set).

...
--confirm-exit
    Set to display confirmation dialog on exit. You can always use 'exit' or 'quit',
    to force a direct exit without any confirmation.
--no-confirm-exit
    Don't prompt the user when exiting. This will terminate the kernel
    if it is owned by the frontend, and leave it alive if it is external.
...

Document release process:

$ git clean -xfd
$ python setup.py sdist  --formats=gztar,zip
$ python setup.py bdist_wheel
$ twine upload dist/*

Need step to check pep440 version number consistency:

$ ls -1 dist
jupyter_console-5.0.0.dev.tar.gz
jupyter_console-5.0.0.dev.zip
jupyter_console-5.0.0.dev0-py2.py3-none-any.whl

Like pushing dev would be wrong as tar and wheel would appear as 2 different versions.

and _version.py is wrong:

version_info = (5, 0, 0, 'dev')
__version__ = '.'.join(map(str, version_info))

As beta and rc should not have dots separating patch versions from suffix.

bash interactive - cannot quit with ctrl+C

just tried to call top with "! top" inside jupiter 4.1.0.dev and I get stuck. Ctrl+C is not working in this case.
Only way to do it is killing the process, after that i return to the console.

jupiter 4.1.0.dev
python 3.5.1
ipython 4.0.1

jupyter console crashing with scala211 kernel

Not sure where to go with this:

phase:scala me$ jupyter console --kernel scala211 --debug
[ZMQTerminalIPythonApp] Searching [u'/Users/me/dev/scala', '/Users/me/.jupyter', '/System/Library/Frameworks/Python.framework/Versions/2.7/etc/jupyter', '/usr/local/etc/jupyter', '/etc/jupyter'] for config files
[ZMQTerminalIPythonApp] Looking for jupyter_config in /etc/jupyter
[ZMQTerminalIPythonApp] Looking for jupyter_config in /usr/local/etc/jupyter
[ZMQTerminalIPythonApp] Looking for jupyter_config in /System/Library/Frameworks/Python.framework/Versions/2.7/etc/jupyter
[ZMQTerminalIPythonApp] Looking for jupyter_config in /Users/me/.jupyter
[ZMQTerminalIPythonApp] Looking for jupyter_config in /Users/me/dev/scala
[ZMQTerminalIPythonApp] Looking for jupyter_console_config in /etc/jupyter
[ZMQTerminalIPythonApp] Looking for jupyter_console_config in /usr/local/etc/jupyter
[ZMQTerminalIPythonApp] Looking for jupyter_console_config in /System/Library/Frameworks/Python.framework/Versions/2.7/etc/jupyter
[ZMQTerminalIPythonApp] Looking for jupyter_console_config in /Users/me/.jupyter
[ZMQTerminalIPythonApp] Looking for jupyter_console_config in /Users/me/dev/scala
[ZMQTerminalIPythonApp] Connection File not found: /Users/me/Library/Jupyter/runtime/kernel-32727.json
[ZMQTerminalIPythonApp] Found kernel julia-0.4 in /Users/me/Library/Jupyter/kernels
[ZMQTerminalIPythonApp] Found kernel haskell in /Users/me/Library/Jupyter/kernels
[ZMQTerminalIPythonApp] Found kernel javascript in /Users/me/Library/Jupyter/kernels
[ZMQTerminalIPythonApp] Found kernel scala211 in /Users/me/.ipython/kernels
[ZMQTerminalIPythonApp] Native kernel (python2) available from /Users/me/Library/Python/2.7/lib/python/site-packages/ipykernel/resources
[ZMQTerminalIPythonApp] Starting kernel: [u'java', u'-jar', u'/Users/me/.ipython/kernels/scala211/launcher.jar', u'--quiet', u'--connection-file', u'/Users/me/Library/Jupyter/runtime/kernel-32727.json']
[ZMQTerminalIPythonApp] Connecting to: tcp://127.0.0.1:55278
[ZMQTerminalIPythonApp] connecting shell channel to tcp://127.0.0.1:55275
[ZMQTerminalIPythonApp] Connecting to: tcp://127.0.0.1:55275
[ZMQTerminalIPythonApp] connecting iopub channel to tcp://127.0.0.1:55276
[ZMQTerminalIPythonApp] Connecting to: tcp://127.0.0.1:55276
[ZMQTerminalIPythonApp] connecting stdin channel to tcp://127.0.0.1:55277
[ZMQTerminalIPythonApp] Connecting to: tcp://127.0.0.1:55277
[ZMQTerminalIPythonApp] connecting heartbeat channel to tcp://127.0.0.1:55279
Jupyter Console 4.1.1

[ZMQTerminalIPythonApp] Starting the jupyter console mainloop...

In [1]: val z = 5
WARNING: The kernel did not respond to an is_complete_request. Setting `use_kernel_is_complete` to False.
z: Int = 5
Traceback (most recent call last):
  File "/Users/me/Library/Python/2.7/bin/jupyter-console", line 11, in <module>
    sys.exit(main())
  File "/Users/me/Library/Python/2.7/lib/python/site-packages/jupyter_core/application.py", line 267, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/Users/me/Library/Python/2.7/lib/python/site-packages/traitlets/config/application.py", line 596, in launch_instance
    app.start()
  File "/Users/me/Library/Python/2.7/lib/python/site-packages/jupyter_console/app.py", line 152, in start
    self.shell.mainloop()
  File "/Users/me/Library/Python/2.7/lib/python/site-packages/jupyter_console/interactiveshell.py", line 483, in mainloop
    self.interact(display_banner=display_banner)
  File "/Users/me/Library/Python/2.7/lib/python/site-packages/jupyter_console/interactiveshell.py", line 659, in interact
    self.run_cell(source_raw)
  File "/Users/me/Library/Python/2.7/lib/python/site-packages/jupyter_console/interactiveshell.py", line 203, in run_cell
    self.handle_execute_reply(msg_id, timeout=0.05)
  File "/Users/me/Library/Python/2.7/lib/python/site-packages/jupyter_console/interactiveshell.py", line 221, in handle_execute_reply
    status = content['status']
KeyError: 'status'

Any ideas?

%paste magic like ipython

It would be awesome if you could implement the %paste magic (like ipython console) for copy & paste big code blocks.

Do not own kernel

When user start a qtconsole and request an exit:

exit(keep_kernel=True)

the kernel is kept safe and user can connect back again. This is not the case for jupyter_console and #91 occurs.

Code duplication with IPython

As we've switched both jupyter_console and IPython over to prompt_toolkit, we've got quite a bit of similar code between the two terminal interfaces, and it's at risk of getting out of sync, mainly as we make changes in IPython. We deliberately changed j_c not to inherit from IPython, because it made it much easier to understand what the code was doing: there's a lot of complexity in IPython that isn't needed for a Jupyter frontend.

Options I can see:

  1. Live with it - the benefits of having two codebases that can evolve separately may well outweigh the downsides of duplicated code.
  2. Re-inherit from IPython - I really don't want to do this.
  3. Make a separate package of 'IPython & Jupyter prompt_toolkit related stuff' - this is in some sense the best way to represent the real relationship of dependencies, but it would be yet another thing to release, and would make it harder to improve either interface quickly.
  4. Make a PT-interface module within IPython, and use that both in IPython and in jupyter_console - a compromise between 2 & 3.

kernel banner missing

The docs on 'Making simple Python wrapper kernels' state, "The ‘banner’ is displayed to the user in console UIs before the first prompt". It works for the qtconsole but not the terminal console.

Originally jupyter/jupyter_client#123

Auto-completion in ipdb freezes up terminal

How to reproduce

Create a file foo.py with these contents

def main():
    really_long_name = 2;
    import ipdb; ipdb.set_trace()

Start a IPython session

$ jupyter console
In [1]: import foo
In [2]: foo.main()
--Return--
None
> foo.py(3)main()
      1 def main():
      2     really_long_name = 2;
----> 3     import ipdb; ipdb.set_trace()
ipdb> r

Hit <TAB> and the terminal freezes up for about 5 seconds. Also you don't get any autocompletion.

I suspect the problem comes from the interaction between the jupyter shell and ipdb, because the autocompletion works when you don't use jupyter:

$ python3
Type "help", "copyright", "credits" or "license" for more information.
>>> import foo
>>> foo.main()
--Return--
None
> foo.py(3)main()
      1 def main():
      2     really_long_name = 2;
----> 3     import ipdb; ipdb.set_trace()

ipdb> r
%%ruby            %rerun            %run              reps/
%recall           %reset            raise             research/
%rehashx          %reset_selective  range             return
%reload_ext       %rm               really_long_name  reversed
%rep              %rmdir            repr              round

I can reproduce this problem on a different machine.
The versions used are:

$ pip3 freeze | grep -i "jupyter\|ipdb\|ipython"
ipdb==0.8.1
ipython==4.0.0
ipython-genutils==0.1.0
jupyter==1.0.0
jupyter-client==4.1.0
jupyter-console==4.0.3
jupyter-core==4.0.6

bash interactive - cannot see screen update

using jupyter-qtconsole the user is not able to see the screen updates when calling bash commands with !.

A simple "! top" in qt console executes the command but the output in the screen is scrambled and not visible at all.

This differs from the terminal console behaviour #39, since from here we are able to terminate the command with ctrl+c.

jupiter 4.1.0.dev
python 3.5.1
ipython 4.0.1

copy paste

Copy and paste to/from the Jupyter terminal isn't working.

Release a beta

As the current version is incompatible with IPython 5.0 beta. .

4.0.1 and main

Just upgraded to 4.0.1 as part of pip install jupyter and got this:

aklaver@panda:~/py_virt/pandas> jupyter console
Traceback (most recent call last):
File "/usr/bin/jupyter-console", line 7, in
from jupyter_console import main
ImportError: cannot import name main

When I downgraded to 4.0.0:

aklaver@panda:~/py_virt/pandas> sudo pip install jupyter-console==4.0.0

it worked:

aklaver@panda:~/py_virt/pandas> jupyter-console
Jupyter Console 4.0.0

[ZMQTerminalIPythonApp] Loading IPython extension: storemagic

In [1]:

completion shows traceback if previous prompt was interrupted with Ctrl-C

$ jupyter console
Jupyter Console 4.0.0

[ZMQTerminalIPythonApp] Loading IPython extension: storemagic
[ZMQTerminalIPythonApp] Loading IPython extension: autoreload
[ZMQTerminalIPythonApp] Loading IPython extension: line_profiler
[ZMQTerminalIPythonApp] Loading IPython extension: memory_profiler

In [1]: # <--- Ctrl-C
KeyboardInterrupt

In [1]: cd ---------------------------------------------------------------------------
KeyboardInterrupt                         Traceback (most recent call last)
/usr/lib/python3.4/site-packages/ipykernel/eventloops.py in process_stream_events()
     23         from IPython.core.interactiveshell import NoOpContext as context
     24 
---> 25     def process_stream_events():
        global process_stream_events = undefined
     26         while stream.getsockopt(zmq.EVENTS) & zmq.POLLIN:
     27             with context():

KeyboardInterrupt:

<correct list of completion follows>

Arch Linux standard packages:
jupyter-client==4.0.0
jupyter-console==4.0.0
jupyter-core==4.0.4

Additional parts of substring when attempting code completion

Hi!

Not sure if this is the right repository for this issue, if not please accept my apologies.
After my latest package updates I've noticed a really strange behaviour for jupyter code completion. What's happening is that when starting to type e.g. a variable name or a package name and then using code completion, additional characters are inserted (i.e. parts of e.g. the file name are repeated) depending on previous tab completions. Steps to reproduce and screenshot below.

I'm running jupyter-console 5.0.0 on an Anaconda installation of Python 3.5.2 on Mac OS X (10.11.6).

Example:

  1. >>> from pyramid.c <tab> completes to >>> from pyramid.co, showing a dropdown with the two options "pyramid.compat" and "pyramid.config"
  2. Selecting either of them results in from pyramid.cod.compat or pyramid.cod.config
  3. >>> from pyramid.co <tab> opens the dropdown, the completion by selecting one of the options works though.

Same thing happens with variable names with underscores present:

  1. >>> variable_name_one = 1
  2. >>> variable_name_two = 2
  3. vari <tab> completes to variable_name_ and opens the dropdown showing both names
  4. Selecting either of them results in variable_name_le_name_xxx

When completing from a different position in the name:
5. varia <tab> completes to variable_name_ and opens the dropdown showing both names
6. Selection either results in variable_name_able_name_xxx

  1. variable_name_ <tab> and selecting from the dropdown works though.

I'm absolutely clueless what might trigger that behaviour, so again: I'm sorry if jupyter-console is the wrong place to report that.

Cheers!
Holger

screen shot 2016-08-09 at 19 28 12

console does not send is_complete_requests?

I was implementing the latest protocol in JuliaLang/IJulia.jl#325, and I wanted to test out my handling of the is_complete_request message. However, the console front-end does not seem to send this message to check whether inputs are complete; it just sends an execute_request whenever you hit <enter>.

Docs

There currently aren't any. We should have:

  • A brief narrative introduction
  • Documentation of config options
  • Docs building on RTD

I don't think API docs are a priority here - it's not clear that this package has anything we'd really consider public API.

%pdb hangs the kernel

Hi,

pretty easy to reproduce:

jupyter console
In [1]: x=10
In [2]: %pdb
Automatic pdb calling has been turned ON
In [3]: x.error()

hangs after [3].

Calling before or after doesnt make a difference.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.