I followed (actually, I authored) the instructions in this gist in order to modify the ipy_repl.py
file that ships with SublimeREPL in order to get it working with more recent versions of IPython at the time. However, I recently pip
upgraded my IPython and Jupyter packages
pip3 install -U ipython jupyter
to the latest versions, and now I'm getting this error when trying to start an IPython session from Sublime:
Traceback (most recent call last):
File "/home/mattdmo/.config/sublime-text-3/Packages/SublimeREPL/config/Python/ipy_repl.py", line 66, in <module>
embedded_shell.initialize()
File "<decorator-gen-113>", line 2, in initialize
File "/usr/local/lib/python3.5/dist-packages/traitlets/config/application.py", line 74, in catch_config_error
return method(app, *args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/jupyter_console/app.py", line 137, in initialize
self.init_shell()
File "/usr/local/lib/python3.5/dist-packages/jupyter_console/app.py", line 110, in init_shell
client=self.kernel_client,
File "/usr/local/lib/python3.5/dist-packages/traitlets/config/configurable.py", line 412, in instance
inst = cls(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/jupyter_console/ptshell.py", line 252, in __init__
self.init_prompt_toolkit_cli()
File "/usr/local/lib/python3.5/dist-packages/jupyter_console/ptshell.py", line 404, in init_prompt_toolkit_cli
self.pt_cli = CommandLineInterface(app, eventloop=self._eventloop)
File "/usr/local/lib/python3.5/dist-packages/prompt_toolkit/interface.py", line 80, in __init__
self.output = output or create_output()
File "/usr/local/lib/python3.5/dist-packages/prompt_toolkit/shortcuts.py", line 124, in create_output
ansi_colors_only=ansi_colors_only, term=term)
File "/usr/local/lib/python3.5/dist-packages/prompt_toolkit/terminal/vt100_output.py", line 425, in from_pty
assert stdout.isatty()
AssertionError
I did a little digging, and at some point after early February 2016, the prompt_toolkit
module came into use in jupyter_console
. While I assume this gives some advantages to the overall project, one disadvantage is that all text interfaces communicating with jupyter_console
must be TTYs (a rather silly requirement, IMO), which a Sublime view is not.
I was unable to find a way around this bug feature. Does anyone know how to work around this?