Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracebacks are not shown right away when connecting to 'ipython kernel' from 'jupyter console' #11894

Open
asmeurer opened this issue Sep 23, 2019 · 6 comments

Comments

@asmeurer
Copy link
Contributor

If I start ipython kernel in one terminal and start jupyter console --existing <.json from ipython kernel> in another terminal, any command that produces an exception causes an error. The output of the exception is not shown immediately after pressing Enter. After pressing Enter a second time, it shows the exception and also an error message from the kernel

In [1]: b64decode('x')

In [1]: ---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-1-182bb76b5423> in <module>
----> 1 b64decode('x')

NameError: name 'b64decode' is not defined
/Users/aaronmeurer/anaconda3/envs/pyflyby/lib/python2.7/site-packages/jupyter_console/ptshell.py:623: UserWarning: The kernel did not respond properly to an is_complete_request: {'parent_header': {u'username': u'aaronmeurer', u'version': u'5.3', u'msg_type': u'execute_request', u'msg_id': u'8a3e61ee-b38698ab3a87e1d7244a6c46', u'session': u'2487d330-2d0fe213a7e17404d7518dfd', u'date': datetime.datetime(2019, 9, 23, 19, 47, 37, 186415, tzinfo=tzutc())}, 'msg_type': u'execute_reply', 'msg_id': u'490e53e1-b166e96a1846e72a884b65d1', 'content': {u'status': u'error', u'ename': u'NameError', u'evalue': u"name 'b64decode' is not defined", u'traceback': [u'\x1b[0;31m---------------------------------------------------------------------------\x1b[0m', u'\x1b[0;31mNameError\x1b[0m                                 Traceback (most recent call last)', u"\x1b[0;32m<ipython-input-1-182bb76b5423>\x1b[0m in \x1b[0;36m<module>\x1b[0;34m\x1b[0m\n\x1b[0;32m----> 1\x1b[0;31m \x1b[0mb64decode\x1b[0m\x1b[0;34m(\x1b[0m\x1b[0;34m'x'\x1b[0m\x1b[0;34m)\x1b[0m\x1b[0;34m\x1b[0m\x1b[0;34m\x1b[0m\x1b[0m\n\x1b[0m", u"\x1b[0;31mNameError\x1b[0m: name 'b64decode' is not defined"], u'execution_count': 1, u'user_expressions': {}, u'engine_info': {u'engine_id': -1, u'method': u'execute', u'engine_uuid': u'7ac3b0bd-8d74-4d39-b0de-e7f04676b034'}, u'payload': []}, 'header': {u'username': u'aaronmeurer', u'version': u'5.3', u'msg_type': u'execute_reply', u'msg_id': u'490e53e1-b166e96a1846e72a884b65d1', u'session': u'37ebdc70-3e2fce541a70bb4c3b93f4de', u'date': datetime.datetime(2019, 9, 23, 19, 47, 37, 401944, tzinfo=tzutc())}, 'buffers': [], 'metadata': {u'started': u'2019-09-23T19:47:37.188714Z', u'dependencies_met': True, u'status': u'error', u'engine': u'7ac3b0bd-8d74-4d39-b0de-e7f04676b034'}}.
  warn('The kernel did not respond properly to an is_complete_request: %s.' % str(msg))

If I use jupyter kernel instead of ipython kernel to start the kernel, it works fine.

Is there any reason to use ipython kernel over jupyter kernel? I noticed that jupyter kernel seems to behave better in general, so I'm wondering if ipython kernel is deprecated.

@telamonian
Copy link
Contributor

I'm able to reproduce this as well, but only in a fresh virtual environment. In my main environment, I don't see the problem. There must be some recent update in some package that's to blame. It does not appear to be an issue with ipython itself (I just ran pip install -U ipython and tried again).

@telamonian
Copy link
Contributor

I think I got the problem package. Doing:

pip install -U ipykernel

in my main env now allows me to reproduce the OP's issue

@asmeurer
Copy link
Contributor Author

Yes, there's definitely a newish version of something that causes this. It didn't happen a few months ago.

@asmeurer
Copy link
Contributor Author

Based on Travis history, this may have broken somewhere between ipykernel 5.1.1 and 5.1.2.

@asmeurer
Copy link
Contributor Author

Yep, that is the problem. I bisected it to ipykernel commit 970ba1af5d441fbeec4e695c42eeea7eb8e6f05a, from ipython/ipykernel#412. CC @MSeal. Someone with the permissions to do so might want to move this issue to the ipykernel repo.

@asmeurer
Copy link
Contributor Author

Actually it looks like this is already fixed in ipykernel master. Any chance we could get a release @Carreau?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants